fontlab.flAxis · declarations 001
_has_axis_name
_has_axis_name(*args: Any, **kwargs: Any) -> Any
QString _check_axis_name(QList
Checks axis name uniqueness. When called for a boolean check, returns True if name is already used by any axis in the list (excluding the axis at index exclude). When called for a safe name, returns name unchanged if it is unique, or a modified version (e.g. "Weight2") if it is already taken. Both overloads are registered under this single Python name.
Source: FontLab Proteus API documentation
checkValue
checkValue(v: float) -> float
double checkValue(double v)
Clamps v to the valid range [minimal, maximum]. If you pass in 950 on an axis with maximum 900, you get 900 back
Source: FontLab Proteus API documentation
default
instance-attribute
default: Any
double
The default user-space value. This is the value used when no axis value is specified by a font user. It's also the 0 point in the normalized range
Source: FontLab Proteus API documentation
designDef
instance-attribute
designDef: Any
double
The default value in internal design space
Source: FontLab Proteus API documentation
designMax
instance-attribute
designMax: Any
double
The maximum value in internal design space
Source: FontLab Proteus API documentation
designMin
instance-attribute
designMin: Any
double
The minimum value in internal design space. If you're not using a non-linear map, this equals minimal
Source: FontLab Proteus API documentation
extrapolate
instance-attribute
extrapolate: Any
bool
Defaults to False. Allows the Variations widget and panel to reach 25% beyond each end of the design range, without changing declared or exported axis bounds. Saved with the font.
Source: FontLab Proteus API documentation
getRange
getRange() -> float
double getRange()
Returns maximum − minimum. A quick way to get the total span of the axis
Source: FontLab Proteus API documentation
hidden
instance-attribute
hidden: Any
bool
When True, this axis is hidden from the user-facing axis list. Useful for internal-only axes that you don't want exposed in the exported font's UI
Source: FontLab Proteus API documentation
instanceIndex
instanceIndex(v: float) -> int
int instanceIndex(double v)
Returns the index of the named instance nearest to the value v. Useful for looking up instances in the instances list
Source: FontLab Proteus API documentation
instances2map
instances2map() -> bool
bool instances2map()
Builds the axis map by reading the current named instances. Useful when you've manually set up instances and want the map to reflect them
Source: FontLab Proteus API documentation
instances2string
instances2string() -> Any
string instances2string()
Serializes the named-instance list to a compact string. Useful for debugging or storing instance data externally
Source: FontLab Proteus API documentation
isWeight
isWeight(s: Any) -> bool
bool isWeight(string s)
Returns True if the string s matches the OpenType weight axis tag (wght). Use this to identify which axis controls weight without hardcoding the string
Source: FontLab Proteus API documentation
isWidth
isWidth(s: Any) -> bool
bool isWidth(string s)
Returns True if s matches the OpenType width axis tag (wdth)
Source: FontLab Proteus API documentation
locationName
locationName(axes: list[flAxis], location: flLocation) -> str
QString locationName(QList
Generates a human-readable name for a design-space location based on all the axis values it contains. For example, {"wght": 700, "wdth": 75} might produce "Bold Condensed"
Source: FontLab Proteus API documentation
map
instance-attribute
map: Any
QMap
A piecewise-linear map from design-space values to user-space values. Each entry is a (design_value, user_value) pair. An empty map means the spaces are identical
Source: FontLab Proteus API documentation
map2instances
map2instances() -> bool
bool map2instances()
Pushes the axis value map onto the named instances, updating each instance's stored axis value to its mapped equivalent
Source: FontLab Proteus API documentation
mappedValue
mappedValue(v: float) -> float
double mappedValue(double v)
Applies the axis's design-to-user-space map to a raw design-space value, returning the corresponding user-space value
Source: FontLab Proteus API documentation
maximum
instance-attribute
maximum: Any
double
The maximum user-space value — the "heaviest" or "most extended" master
Source: FontLab Proteus API documentation
minimal
instance-attribute
minimal: Any
double
The minimum user-space value for this axis — the value at the "lightest" or "most condensed" master
Source: FontLab Proteus API documentation
name
instance-attribute
name: Any
string
The full axis name as it appears in Font Info, e.g. "Weight" or "Width". For registered axes, this name matches the OpenType spec
Source: FontLab Proteus API documentation
normalize
normalize(userValue: float) -> float
double normalize(double userValue)
Converts a user-space value to the OpenType normalized range: −1 at minimum, 0 at default, +1 at maximum. The normalized value is what the interpolation math actually uses
Source: FontLab Proteus API documentation
onEdge
onEdge(v: float) -> bool
bool onEdge(double v)
Returns True if v equals exactly minimal or maximum — i.e., the value sits at one of the extreme ends of the axis range
Source: FontLab Proteus API documentation
playRange
instance-attribute
playRange: Any
(double, double)
The range used when you animate the axis in FontLab's preview. You might set this narrower than the full minimal–maximum range to focus on a particular segment during playback
Source: FontLab Proteus API documentation
shortName
instance-attribute
shortName: Any
string
A short display abbreviation, e.g. "Wt" or "Wd". Shown in UI slots too narrow for the full name
Source: FontLab Proteus API documentation
string2instances
string2instances(s: Any) -> bool
bool string2instances(string s)
Parses instances from a compact string. The inverse of instances2string
Source: FontLab Proteus API documentation
styleName
styleName(v: float) -> Any
string styleName(double v)
Returns the name of the named instance that is closest to the value v on this axis
Source: FontLab Proteus API documentation
styleValue
styleValue(style_name: Any) -> float
double styleValue(string style_name)
Returns the axis value associated with the named instance that has style_name as its name. The reverse of styleName
Source: FontLab Proteus API documentation
tag
instance-attribute
tag: Any
string
The 4-character OpenType axis tag, e.g. "wght", "wdth", "ital". For registered axes use the standard tag. Custom axes should use all-uppercase 4-char tags, e.g. "XOPQ"
Source: FontLab Proteus API documentation
updateInstances
updateInstances() -> None
void updateInstances()
Refreshes the list of named instances to be consistent with the current axis range and mapping
Source: FontLab Proteus API documentation
updateShortName
updateShortName() -> None
void updateShortName()
Re-derives the short display name from the axis name. The short name is a compact abbreviation shown in tight UI spaces
Source: FontLab Proteus API documentation
updateTag
updateTag() -> None
void updateTag()
Re-derives the 4-letter OpenType tag from the axis name. Call this after changing the axis name if you want FontLab to auto-assign a standard tag. For example, naming the axis "Weight" will set the tag to "wght"
Source: FontLab Proteus API documentation
valueWeight
valueWeight(location: flLocation, value: float) -> float
double valueWeight(flLocation location, double value)
Maps a raw weight axis value to its CSS font-weight equivalent (100–900 scale). Useful for generating CSS from your variable font's design space
Source: FontLab Proteus API documentation
valueWidth
valueWidth(location: flLocation, value: float) -> float
double valueWidth(flLocation location, double value)
Maps a raw width axis value to its CSS font-stretch percentage equivalent
Source: FontLab Proteus API documentation