|
| | ON_FontGlyph ()=default |
| |
| | ON_FontGlyph (const class ON_Font *font, ON__UINT32 code_point) |
| |
| | ON_FontGlyph (const ON_FontGlyph &src) |
| |
| | ~ON_FontGlyph ()=default |
| |
| const ON__UINT32 | CodePoint () const |
| |
| bool | CodePointIsSet () const |
| |
| void | Dump (bool bIncludeCharMaps, ON_TextLog &text_log) const |
| |
| void | Dump (bool bIncludeFont, bool bIncludeCharMaps, bool bIncludeSubstitute, bool bIncludeFontUnitTextBox, ON_TextLog &text_log) const |
| |
| const class ON_Font * | Font () const |
| |
| const ON__UINT_PTR | FontGlyphId () const |
| |
| bool | FontGlyphIdIsSet () const |
| |
| unsigned int | FontGlyphIndex () const |
| |
| bool | FontGlyphIndexIsSet () const |
| |
| const ON_TextBox & | FontUnitGlyphBox () const |
| |
| bool | GetGlyphContours (bool bSingleStrokeFont, double height_of_capital, ON_ClassArray< ON_SimpleArray< ON_Curve * > > &glyph_contours, ON_BoundingBox *glyph_bbox, ON_3dVector *glyph_advance) const |
| |
| bool | GetOutline (bool bSingleStrokeFont, class ON_Outline &outline) const |
| |
| const ON_TextBox & | GlyphBox () const |
| |
| bool | IsEndOfLineCodePoint () const |
| |
| bool | IsManaged () const |
| |
| const ON_FontGlyph * | ManagedGlyph () const |
| |
| ON_FontGlyph & | operator= (const ON_FontGlyph &src) |
| |
| const ON_FontGlyph * | RenderGlyph (bool bUseReplacementCharacter) const |
| |
| bool | SetCodePoint (const class ON_Font *font, ON__UINT32 code_point) |
| |
| const ON_FontGlyph * | SubstituteGlyph () const |
| |
|
| static int | CompareCodePointAndFont (const ON_FontGlyph &lhs, const ON_FontGlyph &rhs) |
| |
| static int | GetGlyphList (const wchar_t *text, const class ON_Font *font, ON__UINT32 unicode_CRLF_code_point, ON_SimpleArray< const ON_FontGlyph * > &glyph_list, bool applyKerning, double lineSpaceScale, ON_TextBox &text_box) |
| |
| static int | GetGlyphList (const wchar_t *text, const class ON_Font *font, ON__UINT32 unicode_CRLF_code_point, ON_SimpleArray< const ON_FontGlyph * > &glyph_list, ON_TextBox &text_box) |
| |
| static int | GetGlyphList (size_t code_point_count, ON__UINT32 *code_points, const class ON_Font *font, ON__UINT32 unicode_CRLF_code_point, ON_SimpleArray< const ON_FontGlyph * > &glyph_list, bool applyKerning, double lineSpaceScale, ON_TextBox &text_box) |
| |
| static int | GetGlyphList (size_t code_point_count, ON__UINT32 *code_points, const class ON_Font *font, ON__UINT32 unicode_CRLF_code_point, ON_SimpleArray< const ON_FontGlyph * > &glyph_list, ON_TextBox &text_box) |
| |
| static int | GetGlyphListBoundingBox (const wchar_t *text, const class ON_Font *font, bool applyKerning, double lineSpaceScale, ON_TextBox &text_box) |
| |
| static int | GetGlyphListBoundingBox (const wchar_t *text, const class ON_Font *font, ON_TextBox &text_box) |
| |
| static int | GetGlyphListBoundingBox (size_t code_point_count, ON__UINT32 *code_points, const class ON_Font *font, ON_TextBox &text_box) |
| |
| static int | GetGlyphListKerningOffsets (unsigned int code_point_count, ON__UINT32 *code_points, const class ON_Font *font, ON_SimpleArray< double > &kerning_offsets) |
| |
| static bool | GetStringContours (const wchar_t *text_string, const class ON_Font *font, bool bSingleStrokeFont, double height_of_capital, bool make_small_caps, double small_caps_scale, bool apply_kerning, ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &string_contours) |
| |
| static bool | GetStringContours (const wchar_t *text_string, const class ON_Font *font, bool bSingleStrokeFont, double height_of_capital, bool make_small_caps, double small_caps_scale, ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &string_contours) |
| |
| static bool | GetStringContours (const wchar_t *text_string, const class ON_Font *font, bool bSingleStrokeFont, double height_of_capital, double small_caps_scale, ON_ClassArray< ON_ClassArray< ON_SimpleArray< ON_Curve * > > > &string_contours) |
| |
| static bool | IsCarriageReturnAndLineFeed (ON__UINT32 unicode_code_point, ON__UINT32 next_unicode_code_point) |
| |
| static bool | IsEndOfLineCodePoint (ON__UINT32 unicode_code_point) |
| |
The best way to get a useful ON_FontGlyph is to call ON_Font.CodePointGlyph(unicode_code_point)
Description: Get glyph contours as NURBS curves. Parameters: bSingleStrokeFont - [in] If true, open contours will not be closed by adding a line segment. height_of_capital - [in] If > 0, output curves, bounding box, and advance vector are scaled by height_of_capital/(font design capital height). For fonts like Arial, Helvetica, Times Roman, and Courier this means the height of H and I will be height_of_capital. Otherwise, no scaling is applied to the output curves, bounding box, and advance vector. Pass 0.0 or in this->Font()->HeightOfI() to get the contours to be in opennurbs normalized font coordinates. All other values < 0 are treated as 0.0. glyph_contours - [out] glyph_bbox - [out] glyph bounding box. glyph_advance - [out] glyph_advance->x = horizontal advance to apply when rendering glyphs horizontally. A positive horizontal advance indicates advance to the right. glyph_advance->y = vertical advance to apply when rendering glyphs vertically. A positive vertical advance indicates advance downwards.
Parameters: text - [in] Null terminated wchar_t string. font - [in] The font used to render the glyphs. unicode_CRLF_code_point - [in] If unicode_CRLF_code_point is a valid unicode code point, then consecutive carriage return line feed pairs are converted to a single glyph with code point = unicode_CRLF_code_point.
ON_UnicodeCodePoint::ON_LineSeparator is a good choice when you want to
condense carriage return line feed pairs to a single unambiguous code point.
ON_UnicodeCodePoint::ON_InvalidCodePoint is a good choice when you want to preserve carriage return line feed pairs as two separate glyphs.
glyph_list - [out] Note that glyph_list.Count() is often different than the length of the text string or the number of unicode codepoints in the decoded text. Adjacent carriage return and line feed codepoints are converted to single a hard end of line. All trailing end of line code points are removed from text. Invalid unicode encoding sequences are replaced with ON_UnicodeCodePoint::ReplacementCharacter glyphs.
text_box - [out] tight bounding boxt of text extents. text_box.m_advance.i = maximum of all line horizontal advance values.. text_box.m_advance.j = vertical advance to baseline of last line If if the font height is ON_Font::Constants::AnnotationFontCellHeight. If you will render the font at a different height from ON_Font::Constants::AnnotationFontCellHeight, then use ON_TextBox::Scale as follows: ON_TextBox scaled_box = ON_TextBox::Scale( text_box, (font render height)/((double)ON_Font::Constants::AnnotationFontCellHeight) ); Return: number of lines of text or 0 if input is not valid or text is empty.
| const ON_FontGlyph* ON_FontGlyph::RenderGlyph |
( |
bool |
bUseReplacementCharacter | ) |
const |
Parameters: bUseReplacementCharacter - [in] When this->CodePointIsSet() is true, and bUseReplacementCharacter is true, and no reasonable glyph definition exists, and no substituted is available, then the replacement character glyph for UNICODE code point ON_UnicodeCodePoint::ON_ReplacementCharacter (U+FFFD) will be returned.
Returns: A managed glyph that can be used to render "this". If this->CodePointIsSet() is false, nullptr is returned. If this->CodePointIsSet() is true, the returned glyph may have a different font and code point when the current computer requires font or glyph substitution to draw the glyph. When the current platform cannot render this, nullptr or the replacement glyph is returned depending on the value of bUseReplacementCharacter.
See Also: ON_FontGlyph.SubstituteGlyph().