fontlabapp.glyphs.identity_tools.glyph_identity.suffix_tool · declarations 001
Back to fontlabapp.glyphs.identity_tools.glyph_identity.suffix_tool
KEY
module-attribute
KEY
MODES
module-attribute
MODES
PRESETS
module-attribute
PRESETS
TITLE
module-attribute
TITLE
apply_suffix
apply_suffix(native: Any, qtcore: Any, package_id: int, names: list[str], mode: str, suffix: str, replacement: str = '', clear_unicode: bool = False, *, disclosure: dict[str, Any] | None = None) -> list[tuple[str, str]]
Rename NAMES by suffix. One Undo step. Return [(old, new)] renamed.
Rescan first, so a stale preview cannot rename the wrong glyph. When CLEAR_UNICODE is true, each renamed glyph also loses its code points. Raise ValueError for an empty selection, a switched font (queued updates are disclosed).
dotted
dotted(suffix: str) -> str
Return SUFFIX with one leading dot. An empty suffix stays empty.
hexes
hexes(codes: list[int]) -> str
Return codes as "U+0041 U+0042", or an en dash for none.
main
main() -> Any
Open or replace the Suffix Tool panel.
suffixed
suffixed(name: str, mode: str, suffix: str, replacement: str = '') -> str
Return the new name for one glyph, or NAME when the operation does not apply.
Add: append SUFFIX unless NAME already ends with it. Remove: drop the last suffix when it equals SUFFIX (any last suffix if SUFFIX is empty). Replace: swap the last suffix for REPLACEMENT when it equals SUFFIX. The first character is never part of a suffix, so ".notdef" has none.
unicode_loss
unicode_loss(facts: Facts, plan: list[tuple[str, str, str]]) -> dict[str, list[int]]
Return {old name: code points} that a Unicode removal would delete (rows "ok").
unicode_write_guard
unicode_write_guard(package_id: int) -> None
Apply the App Unicode writer guards before any history call.
A regular Font window must be active, and no Glyph editor may be open, even inactive (the host has a Unicode save-cache gap). The public App guards (fontlabapp.core.edit_guards) do both checks; the editor scan has a 2-second limit.