Skip to content

fontlabapp.fontui.hinting

hinting

Hint guard for the studio widgets: read a layer's hint state, remove PostScript hints.

What: layer_is_hinted(layer) returns a HintState from exactly the three native flags that Fontport's outline guard reads (hasHints, hasTTData, hasTTH; fontlab_fontport.host refuses outline edits when any is set). TMetrics and TGlyph check it before outline or sidebearing writes. Advance width and kerning stay editable on a hinted layer.

remove_hints_with_recheck(layer, label, glyph=..., package=...) removes the PostScript hints of that one layer as ONE named Undo step, with flLayer.removeHints(True, True) through core.history.glyphs.commit, then reads the state again. removeHints does not clear TrueType data and there is no TrueType remover, so outline edits stay off while TrueType data remains.

The module imports nothing native at load time. Offline tests do not prove native FontLab behaviour.

Classes

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
PS_TEXT attribute
REMOVED_TEXT attribute
TT_REMAINS_TEXT attribute
TT_TEXT attribute
font_hint_check function (font: Any) -> Callable[[str, str | None], HintState | None] The default <code>hint&#95;check(name, layer)</code><code> of TMetrics and TGlyph over </code><code>font</code>.
hint_state_of function (package: Any, name: str, layer: str | None=None) -> HintState | None <code>layer&#95;is&#95;hinted</code> of that live layer; None when the package, glyph or layer is absent.
layer_is_hinted function (layer: Any) -> HintState Return the <code>HintState</code><code> of </code><code>layer</code><code> (</code><code>None</code> is not hinted).
native_layer function (package: Any, name: str, layer: str | None=None) -> Any The live <code>flLayer</code><code> of glyph </code><code>name</code><code> on </code><code>layer</code><code> (default master) in </code><code>package</code>, or None.
package_of function (font: Any) -> Any The live FontLab package behind a Fontport-backed <code>font</code>, or None (detached or no host).
recheck_text function (state: HintState) -> str Status text after a removal: TrueType remains, still hinted, or removed.
remove_hints_with_recheck function (layer: Any, label: str, *, glyph: Any, package: Any=None, commit: Callable[..., Any] | None=None) -> HintSta… Remove the PostScript hints of <code>layer</code><code> as one Undo step named </code><code>label</code>; re-check.