Struct read_fonts::tables::name::NameId
source · pub struct NameId(/* private fields */);
Expand description
Identifier for an informational string (or name).
A set of predefined identifiers exist for accessing names and other various metadata about the font and those are provided as associated constants on this type.
IDs 26 to 255, inclusive, are reserved for future standard names. IDs 256 to 32767, inclusive, are reserved for font-specific names such as those referenced by a font’s layout features.
For more detail, see https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids
Implementations§
source§impl NameId
impl NameId
sourcepub const COPYRIGHT_NOTICE: NameId = _
pub const COPYRIGHT_NOTICE: NameId = _
Copyright notice.
sourcepub const FAMILY_NAME: NameId = _
pub const FAMILY_NAME: NameId = _
Font family name.
The font family name is used in combination with font subfamily name (ID 2), and should be shared among at most four fonts that differ only in weight or style (as described below).
sourcepub const SUBFAMILY_NAME: NameId = _
pub const SUBFAMILY_NAME: NameId = _
Font subfamily name.
The font subfamily name is used in combination with font family name (ID 1), and distinguishes the fonts in a group with the same font family name. This should be used for style and weight variants only (as described below).
sourcepub const FULL_NAME: NameId = _
pub const FULL_NAME: NameId = _
Full font name that reflects all family and relevant subfamily descriptors.
The full font name is generally a combination of IDs 1 and 2, or of IDs 16 and 17, or a similar human-readable variant.
sourcepub const VERSION_STRING: NameId = _
pub const VERSION_STRING: NameId = _
Version string.
Should begin with the syntax “Version number.number” (upper case, lower case, or mixed, with a space between “Version” and the number).
sourcepub const POSTSCRIPT_NAME: NameId = _
pub const POSTSCRIPT_NAME: NameId = _
PostScript name for the font.
ID 6 specifies a string which is used to invoke a PostScript language font that corresponds to this OpenType font. When translated to ASCII, the name string must be no longer than 63 characters and restricted to the printable ASCII subset, codes 33 to 126, except for the 10 characters ‘[’, ‘]’, ‘(’, ‘)’, ‘{’, ‘}’, ‘<’, ‘>’, ‘/’, ‘%’.
sourcepub const TRADEMARK: NameId = _
pub const TRADEMARK: NameId = _
Trademark; this is used to save any trademark notice/information for this font.
Such information should be based on legal advice. This is distinctly separate from the copyright.
sourcepub const MANUFACTURER: NameId = _
pub const MANUFACTURER: NameId = _
Manufacturer name.
sourcepub const DESCRIPTION: NameId = _
pub const DESCRIPTION: NameId = _
Description of the typeface.
Can contain revision information, usage recommendations, history, features, etc.
sourcepub const VENDOR_URL: NameId = _
pub const VENDOR_URL: NameId = _
URL of font vendor (with protocol, e.g., http://, ftp://).
If a unique serial number is embedded in the URL, it can be used to register the font.
sourcepub const DESIGNER_URL: NameId = _
pub const DESIGNER_URL: NameId = _
URL of typeface designer (with protocol, e.g., http://, ftp://).
sourcepub const LICENSE_DESCRIPTION: NameId = _
pub const LICENSE_DESCRIPTION: NameId = _
License description.
A description of how the font may be legally used, or different example scenarios for licensed use. This field should be written in plain language, not legalese.
sourcepub const LICENSE_URL: NameId = _
pub const LICENSE_URL: NameId = _
URL where additional licensing information can be found.
sourcepub const TYPOGRAPHIC_FAMILY_NAME: NameId = _
pub const TYPOGRAPHIC_FAMILY_NAME: NameId = _
Typographic family name.
The typographic family grouping doesn’t impose any constraints on the number of faces within it, in contrast with the 4-style family grouping (ID 1), which is present both for historical reasons and to express style linking groups.
sourcepub const TYPOGRAPHIC_SUBFAMILY_NAME: NameId = _
pub const TYPOGRAPHIC_SUBFAMILY_NAME: NameId = _
Typographic subfamily name.
This allows font designers to specify a subfamily name within the typographic family grouping. This string must be unique within a particular typographic family.
sourcepub const COMPATIBLE_FULL_NAME: NameId = _
pub const COMPATIBLE_FULL_NAME: NameId = _
Compatible full (Macintosh only).
On the Macintosh, the menu name is constructed using the FOND resource. This usually matches the full name. If you want the name of the font to appear differently than the Full Name, you can insert the compatible full name in ID 18.
sourcepub const SAMPLE_TEXT: NameId = _
pub const SAMPLE_TEXT: NameId = _
Sample text.
This can be the font name, or any other text that the designer thinks is the best sample to display the font in.
sourcepub const POSTSCRIPT_CID_NAME: NameId = _
pub const POSTSCRIPT_CID_NAME: NameId = _
PostScript CID findfont name.
Its presence in a font means that the ID 6 holds a PostScript font name that is meant to be used with the “composefont” invocation in order to invoke the font in a PostScript interpreter.
sourcepub const WWS_FAMILY_NAME: NameId = _
pub const WWS_FAMILY_NAME: NameId = _
WWS family name.
Used to provide a WWS-conformant family name in case the entries for IDs 16 and 17 do not conform to the WWS model.
sourcepub const WWS_SUBFAMILY_NAME: NameId = _
pub const WWS_SUBFAMILY_NAME: NameId = _
WWS subfamily name.
Used in conjunction with ID 21, this ID provides a WWS-conformant subfamily name (reflecting only weight, width and slope attributes) in case the entries for IDs 16 and 17 do not conform to the WWS model.
sourcepub const LIGHT_BACKGROUND_PALETTE: NameId = _
pub const LIGHT_BACKGROUND_PALETTE: NameId = _
Light background palette.
This ID, if used in the CPAL table’s Palette Labels Array, specifies that the corresponding color palette in the CPAL table is appropriate to use with the font when displaying it on a light background such as white.
sourcepub const DARK_BACKGROUND_PALETTE: NameId = _
pub const DARK_BACKGROUND_PALETTE: NameId = _
Dark background palette.
This ID, if used in the CPAL table’s Palette Labels Array, specifies that the corresponding color palette in the CPAL table is appropriate to use with the font when displaying it on a dark background such as black.
sourcepub const VARIATIONS_POSTSCRIPT_NAME_PREFIX: NameId = _
pub const VARIATIONS_POSTSCRIPT_NAME_PREFIX: NameId = _
Variations PostScript name prefix.
If present in a variable font, it may be used as the family prefix in the PostScript Name Generation for Variation Fonts algorithm.
source§impl NameId
impl NameId
sourcepub fn predefined() -> impl Iterator<Item = NameId> + Clone
pub fn predefined() -> impl Iterator<Item = NameId> + Clone
Returns an iterator over the set of predefined identifiers according to the specification.
sourcepub const fn to_be_bytes(self) -> [u8; 2]
pub const fn to_be_bytes(self) -> [u8; 2]
Return the memory representation of this identifier as a byte array in big-endian (network) byte order.
Trait Implementations§
source§impl Domain for NameId
impl Domain for NameId
source§fn is_continuous() -> bool
fn is_continuous() -> bool
source§fn ordered_values() -> impl DoubleEndedIterator<Item = u32>
fn ordered_values() -> impl DoubleEndedIterator<Item = u32>
T
Read moresource§fn ordered_values_range(
range: RangeInclusive<NameId>,
) -> impl DoubleEndedIterator<Item = u32>
fn ordered_values_range( range: RangeInclusive<NameId>, ) -> impl DoubleEndedIterator<Item = u32>
source§impl Ord for NameId
impl Ord for NameId
source§impl PartialOrd for NameId
impl PartialOrd for NameId
impl AnyBitPattern for NameId
impl Copy for NameId
impl Eq for NameId
impl StructuralPartialEq for NameId
Auto Trait Implementations§
impl Freeze for NameId
impl RefUnwindSafe for NameId
impl Send for NameId
impl Sync for NameId
impl Unpin for NameId
impl UnwindSafe for NameId
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)