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.
Sourcepub const LAST_RESERVED_NAME_ID: NameId = _
pub const LAST_RESERVED_NAME_ID: NameId = _
The last value that is explicitly reserved for standard names.
Values after this are available to be used for font-specific names.
See https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids
Sourcepub const LAST_ALLOWED_NAME_ID: NameId = _
pub const LAST_ALLOWED_NAME_ID: NameId = _
The last value that is available for font-specific names.
See https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids
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 is_reserved(self) -> bool
pub const fn is_reserved(self) -> bool
Returns true
if self is in the range 0..=255
(reserved for standard names.)
Sourcepub const fn checked_add(self, rhs: u16) -> Option<NameId>
pub const fn checked_add(self, rhs: u16) -> Option<NameId>
Returns a new NameId
by adding rhs
to the current value.
Returns None
if the result would be greater than Self::LAST_ALLOWED_NAME_ID
.
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<'de> Deserialize<'de> for NameId
impl<'de> Deserialize<'de> for NameId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NameId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<NameId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Domain for NameId
Available on crate feature std
only.
impl Domain for NameId
std
only.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
Source§impl Serialize for NameId
impl Serialize for NameId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
.