Repository navigation
Fix 0.3.0 export bugs: net labels, legend, data-net, symbol glyphs - #50
Merged
Merged
Conversation
Net labels: a style's label on a net is drawn above the wire right past its driver pin, in room the layout makes for it (SchematicLayout::netLabelPlaces(), Port::netLabel): part of the driver's footprint and a routing obstacle, pushed past the instance name when level with its row. Input ports move left so their label sits between the flag and the wire's channel. Never under a box, a name, a flag or a trunk; the same on screen, in SVG and PNG. Legend: lists the colors actually drawn, one entry per wire tree: the style's label and color when a style labels it, else the trace's (each trace of a striped tree); no duplicates, nothing for an unlabeled or faint wire. A style no longer leaves its trace's color in the legend. data-net: a wire tree is named by its driver's net at the driver's level (bus bits as name[bit]), not the driver pin's name. Every equipotential pin carries "net"/"net_id" from both hosts (setNet() in LocalSNLProvider.cpp, net_fields() in protocol.py); older hosts fall back to the pin label. Glyphs: DroidSans has no arrows; a subset of DejaVu Sans (arrows, math operators, punctuation, letterlike symbols, geometric shapes) is merged into the default font (AppFont.cpp, SymbolFont.h, LICENSES/LicenseRef-DejaVu-Fonts.txt), so "→" no longer draws the replacement glyph in PNG exports or on screen. Style resolution: a net item is sent on its net's driver (a top-level input port, else an output leaf pin), not on an output port, which a trace's partial net doesn't list -- styling a traced net ending at an output port did nothing. Tests: label boxes vs boxes/names/flags/trunks, legend == drawn colors, data-net on a fanout-fix demo and across hierarchy, every exported character has a glyph (C++), a PNG with symbols differs from the replacement glyph (Python).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes four bugs in the 0.3.0 export features, found rendering a fanout-fix report (
naja-schematic render ... --style ... --legend --png).Fixes
labelon a net is now drawn above the wire right past its driver pin, in room the layout makes for it (SchematicLayout::netLabelPlaces()): part of the driver's footprint and a routing obstacle, pushed past the instance name when level with its row. Top-level input ports move left so their label sits between the flag and the wire's channel. Same placement on screen, in SVG and in PNG.data-netheld the driver's pin name (O). It's now the net's name at the driver's level (en_q;name[bit]for a bus bit;ninsideu_subacross hierarchy). Both hosts now send"net"/"net_id"on every equipotential pin (setNet()inLocalSNLProvider.cpp,net_fields()inprotocol.py); older hosts fall back to the pin label.→drawn as the replacement glyph in PNGs. Not a glyph-range issue (glyphs load on demand): DroidSans has no arrows. A 53 KB subset of DejaVu Sans (arrows, math operators, punctuation, letterlike symbols, geometric shapes, ✓/✗) is merged into the default font (src/AppFont.cpp,src/SymbolFont.h).Also fixed: a
netstyle item was anchored on any top-level port of the net, including an output port, which a trace's partial net doesn't list, so styling a traced net ending at an output port silently did nothing. It's now sent on the net's driver.Licensing
src/SymbolFont.hbrings in DejaVu's license, added verbatim asLICENSES/LicenseRef-DejaVu-Fonts.txt(Bitstream Vera + Arev, DejaVu changes in the public domain).reuse lintpasses.Tests
test_render.py, new datafanout_fix.v+ style): net label boxes don't overlap any box, port flag or each other (fanout demo and a gate design); legend colors == drawn net colors, with and without a style;data-netnames on the demo, across hierarchy and for bus bits; a PNG with→and other symbols differs from one with a character no font has.SchematicLayoutTest),"net"/"net_id"parsing (TypesJsonTest), and on the real view with the app font (SvgExportTest): labels vs boxes/names/flags/trunks, legend,data-net, every exported character has a glyph.Locally: 256 Python tests (renderer required), 311 + 14 C++ tests pass. Not run locally:
test_notebook.py, the WASM build.