fontlabapp.fontui.teaching_painter.outline_svg
outline_svg
What: Export the current glyph outline as reusable SVG artwork. How: Capture its current-master Qt path, including transformed components. Choose winding or odd-even fill to diagnose counters and overlaps. Why: Keep curves in a vector proof without changing font data. Usage: Open a glyph, Capture, choose a fill rule and Update Proof. Copy SVG or enter a new absolute .svg path and Save SVG. Benefit: Keep rendered artwork for an external vector editor. The frame includes the origin, advance, ascender, descender and ink bounds. One SVG user unit equals one font unit. SVG y increases downward; baseline is y=0.
SVG is a visual proof. It contains no anchors, metrics, hints or raw node flags. Snapshots remain detached. Capture again after changing the current font. Setup: FontLab 9, Python 3.11, Fly, fontlabapp and QtSvg.QSvgGenerator. Independent rewrite of the Qt painterpaths, basicdrawing and transformations example ideas (Qt/Nokia, Riverbank). Consolidated into one outline exporter. 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 |
|---|---|---|---|
HELP |
attribute | ||
KEY |
attribute | ||
TITLE |
attribute | ||
capture_outline |
function | () -> tuple[str, Any, tuple[float, float, float]] |
Double-check the current context and geometry around a detached Qt path. |
font_frame |
function | (path: Any, metrics: tuple[float, float, float]) -> tuple[int, int, int, int] |
Unite ink with origin and metrics; round outward to whole font units. |
main |
function | () -> Any |
Use FontLab's existing application and App's retained panel registry. |
panel_type |
function | (qt: Any) -> type |
Bind a modeless snapshot panel to FontLab's Qt and owned signal scope. |
save_svg |
function | (filename: str, text: str) -> None |
Save an explicit absolute SVG path once; refuse overwrites and empty output. |
suggested_svg_path |
function | (label: str) -> str |
Suggest an absolute Desktop filename; never create a directory or file. |
svg_text |
function | (qt: Any, path: Any, label: str, frame: tuple[int, int, int, int]) -> str |
Let Qt serialize the complete painted path; preserve curves and fill rule. |