Skip to content

fontlabapp.fontui.teaching_painter.svg_reference

svg_reference

What: Compare local SVG reference artwork with the current glyph outline. How: Read the current-master outline and load the whole SVG into a native vector scene item. Fit and center it, or keep SVG user coordinates in font units. Draw the glyph in blue above the translucent reference. No SVG bytes are changed. Why: Compare silhouettes without rasterizing the reference or changing the font. Usage: Open a glyph. Enter an absolute SVG path and click Compare. Opacity updates the loaded reference. Compare again after font changes. Benefit: See proportion differences while designing a glyph in FontLab. Fit mode normalizes silhouettes. Font units mode keeps SVG user coordinates: x increases right, y increases downward, and the glyph baseline is y=0. Neither mode checks imported font metrics. Animated SVG is refused. Rendering uses the SVG features supported by host Qt. Setup: FontLab 9, Python 3.11, Fly, fontlabapp and QtSvg.QGraphicsSvgItem. Independent rewrite of the Qt svgviewer example idea (Qt/Nokia, Riverbank). Based on the author's own FontLab sample, Apache-2.0. No upstream code or assets copied.

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
KEY attribute
TITLE attribute
alignment_matrix function (source: tuple[float, ...], target: tuple[float, ...]) -> tuple[float, ...] Uniformly fit and center source bounds in target bounds; preserve aspect.
capture_outline function () -> tuple[str, Any] Double-check the current context and geometry around a detached Qt path.
main function () -> Any Open via the host registry; never construct another application.
panel_type function (qt: Any) -> type Build an owned vector scene; leave painting and item lifetimes with Qt.
reference_file function (filename: str) -> Path Read only an explicit existing SVG file; never rewrite its payload.
reference_matrix function (source: tuple[float, ...], viewbox: tuple[float, ...], target: tuple[float, ...], font_units: bool) -> tuple… Restore SVG user coordinates before optional silhouette normalization.