15 #if !defined(OPENNURBS_FONT_INC_) 16 #define OPENNURBS_FONT_INC_ 83 int LineSpace()
const;
119 int AscentOfI()
const;
131 double GlyphScale(
double text_height)
const;
140 int StrikeoutThickness()
const;
150 int StrikeoutPosition()
const;
160 int UnderscoreThickness()
const;
170 int UnderscorePosition()
const;
184 bool HeightsAreValid()
const;
191 int strikeout_position,
192 int strikeout_thickness
196 int underscore_position,
197 int underscore_thickness
204 int m_line_space = 0;
205 int m_ascent_of_I = 0;
207 int m_strikeout_thickness = 0;
208 int m_strikeout_position = 0;
210 int m_underscore_thickness = 0;
211 int m_underscore_position = 0;
215 double m_reserved2 = 0.0;
216 double m_reserved3 = 0.0;
217 ON__UINT_PTR m_reserved5 = 0;
229 #pragma region RH_C_SHARED_ENUM [ON_Font::Weight] [Rhino.DocObjects.Font.FontWeight] [nested:byte] 289 static int CompareWeight(
303 unsigned int unsigned_font_weight
322 static int WindowsLogfontWeightFromWeight(
342 static int AppleWeightOfFontFromWeight(
362 static double AppleFontWeightTraitFromWeight(
385 int windows_logfont_weight
405 int apple_weight_of_font
415 double apple_font_weight_trait
418 static const wchar_t* WeightToWideString(
424 #pragma region RH_C_SHARED_ENUM [ON_Font::Stretch] [Rhino.DocObjects.Font.FontStretch] [nested:byte] 428 enum class Stretch : unsigned char
466 unsigned int unsigned_font_stretch
470 #pragma region RH_C_SHARED_ENUM [ON_Font::Style] [Rhino.DocObjects.Font.FontStyle] [nested:byte] 475 enum class Style : unsigned char
503 unsigned int unsigned_font_style
506 static const wchar_t* StyleToWideString(
513 static bool IsValidFaceName(
514 const wchar_t* face_name
521 unsigned char managed_status,
554 static const ON_Font* GetManagedFont(
555 const wchar_t* face_name
558 static const ON_Font* GetManagedFont(
560 const wchar_t* face_name
563 static const ON_Font* GetManagedFont(
564 const wchar_t* face_name,
568 static const ON_Font* GetManagedFont(
570 const wchar_t* face_name,
574 static const ON_Font* GetManagedFont(
575 const wchar_t* face_name,
580 static const ON_Font* GetManagedFont(
582 const wchar_t* face_name,
587 static const ON_Font* GetManagedFont(
588 const wchar_t* face_name,
593 static const ON_Font* GetManagedFont(
595 const wchar_t* face_name,
600 static const ON_Font* GetManagedFont(
601 const wchar_t* face_name,
607 double linefeed_ratio,
608 unsigned int logfont_charset
611 static const ON_Font* GetManagedFont(
613 const wchar_t* face_name,
619 double linefeed_ratio,
620 unsigned int logfont_charset
623 static const ON_Font* GetManagedFontFromFontDescription(
624 const wchar_t* font_description
627 #if defined(ON_OS_WINDOWS_GDI) 657 static const ON_Font* GetManagedFontFromWindowsLogfont(
660 const LOGFONT& logfont
665 MAP_MODE_ZERO_ERROR_SUPPRESS = MM_MAX + 3
670 static const ON_Font* GetManagedFontFromAppleFontName(
671 const wchar_t* apple_font_name
680 const ON_Font* ManagedFont()
const;
720 ON__UINT32 unicode_code_point
725 const class ON_FontGlyph* Internal_ManagedCodePointGlyph(
726 ON__UINT32 unicode_code_point,
727 bool bCreateIfMissing,
728 bool bFindSubstitutes
740 static bool IsNotAppleFontName(
741 const wchar_t* font_description
744 static const ON_Font* GetManagedFont(
745 const ON_Font& font_characteristics,
746 bool bCreateIfNotFound
749 static const ON_Font* GetManagedFontFromSerialNumber(
750 unsigned int managed_font_runtime_serial_number
753 static unsigned int GetManagedFontList(
764 bool IsManagedFont()
const;
795 static void DestroyFreeTypeFace(
819 bool SetFontCharacteristics(
820 const wchar_t* face_name,
848 bool SetFontCharacteristics(
850 const wchar_t* face_name,
867 bool SetFontCharacteristics(
868 const wchar_t* face_name,
876 bool SetFontCharacteristics(
878 const wchar_t* face_name,
886 bool SetFontCharacteristics(
887 const wchar_t* face_name,
893 double linefeed_ratio,
894 unsigned int logfont_charset
897 bool SetFontCharacteristics(
899 const wchar_t* face_name,
905 double linefeed_ratio,
906 unsigned int logfont_charset
918 unsigned int FontCharacteristicsAsUnsigned()
const;
928 static unsigned int Internal_FontCharacteristicsAsUnsigned(
949 bool Internal_SetFontCharacteristicsFromUnsigned(
950 unsigned int font_characteristics_as_unsigned
965 bool bIgnoreFaceNameOrdinalCase
968 #if defined(ON_OS_WINDOWS_GDI) 992 static bool GetWindowsDeviceToLogicalHeightScales(
994 double* device_to_logical_scale,
995 double* logical_to_device_scale
1047 static int WindowsLogfontCharacterHeightFromPointSize(
1083 static double PointSizeFromWindowsLogfontCharacterHeight(
1086 int logfont_character_height
1126 static int WindowsLogfontCharacterHeight(
1129 const LOGFONT& logfont
1169 static int WindowsLogfontCellHeight(
1172 const LOGFONT& logfont
1213 static bool GetWindowsTextMetrics(
1216 const LOGFONT& logfont,
1217 TEXTMETRIC& textmetric
1221 static HDC Internal_CreateWindowsLogfontDeviceContext();
1222 static void Internal_DeleteWindowsLogfontDeviceContext(
1256 bool SetFromWindowsLogFont(
1259 const LOGFONT& logfont
1285 const LOGFONT WindowsLogFont(
1290 const MAT2 WindowsFontMat2()
const;
1294 #if defined (ON_RUNTIME_APPLE_OBJECTIVE_C_AVAILABLE) 1295 bool SetFromAppleFont (NSFont* apple_font);
1296 NSFont* AppleFont()
const;
1299 bool SetFromAppleFontName(
1300 const wchar_t* apple_font_name
1305 const wchar_t* AppleFontNameAsPointer()
const;
1307 bool SetFromFontDescription(
1308 const wchar_t* font_description
1311 bool SetFromFontDescription(
1312 const wchar_t* font_description,
1313 const wchar_t* apple_font_name
1333 bool IsValid(
ON_TextLog* text_log =
nullptr )
const;
1342 static void DumpFreeTypeFace(
1343 ON__UINT_PTR free_type_face_ptr,
1347 #if defined(ON_OS_WINDOWS_GDI) 1348 static void DumpLogfont(
1349 const LOGFONT* logfont,
1386 unsigned int RuntimeSerialNumber()
const;
1403 unsigned int ManagedFontSerialNumber()
const;
1412 #if defined(ON_OS_WINDOWS_GDI) 1413 logfont_ansi_charset = ANSI_CHARSET,
1414 logfont_default_charset = DEFAULT_CHARSET,
1415 logfont_symbol_charset = SYMBOL_CHARSET,
1416 logfont_out_precis = OUT_TT_ONLY_PRECIS,
1423 logfont_quality = DEFAULT_QUALITY,
1425 logfont_pitch_and_family = (DEFAULT_PITCH | FF_DONTCARE),
1430 logfont_ansi_charset = 0,
1431 logfont_default_charset = 1,
1432 logfont_symbol_charset = 2,
1433 logfont_out_precis = 7,
1434 logfont_quality = 4,
1435 logfont_pitch_and_family = 0
1448 static unsigned char WindowsLogfontCharSetFromFaceName(
1449 const wchar_t* face_name
1479 AnnotationFontCellHeight = 256,
1491 MetricsGlyphCodePoint =
'I' 1512 const wchar_t* FontDescriptionAsPointer()
const;
1514 ON_DEPRECATED_MSG(
"Use ON_FontMetrics::DefaultLineFeedRatio")
1515 double LinefeedRatio() const;
1570 double FontUnitToNormalizedScale() const;
1577 double NormalizedToFontUnitScale() const;
1605 double PointSize() const;
1620 bool SetFontFaceName(
1621 const
wchar_t* face_name
1623 const
wchar_t* FontFaceName() const;
1627 int WindowsLogfontWeight() const;
1628 int AppleWeightOfFont() const;
1629 double AppleFontWeightTrait() const;
1635 bool SetWindowsLogfontWeight(
1636 int windows_logfont_weight
1639 bool SetAppleWeightOfFont(
1640 int apple_weight_of_font
1643 bool SetAppleFontWeightTrait(
1644 double apple_font_weight_trait
1648 bool Internal_SetFontWeightTrio(
1650 int windows_logfont_weight,
1651 double apple_font_weight_trait,
1652 bool bUpdateFontDescription
1667 bool IsLight() const;
1680 bool IsNormalWeight() const;
1693 bool IsBold() const;
1706 bool IsItalic() const;
1713 bool IsUpright() const;
1725 bool SetFontStretch(
1729 bool IsUnderlined() const;
1734 bool IsStrikethrough() const;
1735 bool SetStrikethrough(
1739 unsigned char LogfontCharSet() const;
1741 bool SetLogfontCharSet(
1742 unsigned char logfont_charset
1745 ON_DEPRECATED_MSG("Use FontMetrics().AscentOfI()")
1746 int HeightOfI() const;
1748 ON_DEPRECATED_MSG("Use FontMetrics().LineSpace()")
1749 int HeightOfLinefeed() const;
1751 ON_DEPRECATED_MSG("Use FontMetrics().GlyphScale()")
1752 double HeightScale(
double text_height) const;
1754 ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutThickness()")
1755 int GetStrikeoutSize() const;
1757 ON_DEPRECATED_MSG("Use FontMetrics().StrikeoutPosition()")
1758 int GetStrikeoutPosition() const;
1760 ON_DEPRECATED_MSG("Use FontMetrics().UnderscoreThickness()")
1761 int GetUnderscoreSize() const;
1764 ON_DEPRECATED_MSG("Use FontMetrics().UnderscorePosition()")
1765 int GetUnderscorePosition() const;
1785 const class
ON_SHA1_Hash& FontCharacteristicsHash() const;
1804 static
int CompareFontCharacteristics(
1820 static
bool EqualFontCharacteristics(
1845 static
unsigned int __runtime_serial_number_generator;
1846 const
unsigned int m_runtime_serial_number = 0;
1848 int m_windows_logfont_weight = 400;
1849 double m_point_size = 0.0;
1850 double m_apple_font_weight_trait = 0.0;
1855 bool m_font_bUnderlined = false;
1856 bool m_font_bStrikethrough = false;
1860 unsigned char m_reserved_char1 = 0;
1880 face_name_capacity = 32
1883 wchar_t m_face_name[ON_Font::face_name_capacity+2];
1887 double m_reserved_double_0 = 0.0;
1888 double m_reserved_double_1 = 0.0;
1909 bool ModificationPermitted(
1910 const char* function_name,
1911 const char* file_name,
1916 void Internal_SetFontDescription();
1928 void DestroyFontGlyphCache();
1929 class ON_FontGlyphCache* FontGlyphCache(
1930 bool bCreateIfMissing
1932 #pragma ON_PRAGMA_WARNING_PUSH 1933 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 ) 1938 mutable std::shared_ptr<class ON_FontGlyphCache> m_font_glyph_cache;
1939 #pragma ON_PRAGMA_WARNING_POP 1947 mutable class ON_FreeTypeFace* m_free_type_face =
nullptr;
1950 ON__UINT_PTR m_reserved_ptr = 0;
1955 typedef ON__UINT_PTR (*ON_GetGlyphMetricsFuncType)(
1957 ON__UINT32 unicode_code_point,
1961 typedef void (*ON_GetFontMetricsFuncType)(
1966 static void SetCustomMeasurementFunctions(
1967 ON_GetGlyphMetricsFuncType measureGlyphFunc,
1968 ON_GetFontMetricsFuncType metricsFunction
1972 static ON_GetGlyphMetricsFuncType Internal_CustomGetGlyphMetricsFunc;
1973 static ON_GetFontMetricsFuncType Internal_CustomGetFontMetricsFunc;
1976 static void GetRunBounds(
1978 const wchar_t* text,
1979 double fontSizePixels,
1980 ON::TextHorizontalAlignment horizontalAlignment,
1981 ON::TextVerticalAlignment verticalAlignment,
2024 const ON_2dex& delta
2053 ON_2dex m_bbmin = ON_2dex::Unset;
2054 ON_2dex m_bbmax = ON_2dex::Unset;
2058 ON_2dex m_max_basepoint = ON_2dex::Zero;
2070 ON_2dex m_advance = ON_2dex::Zero;
2081 enum class ContourPointType : ON__UINT8
2088 QuadraticBezierPoint = 3,
2091 CubicBezierPoint = 4,
2095 LineToCloseContour = 5
2104 ON__UINT8 m_bToPoint = 0;
2106 ON__UINT16 m_contour_index = 0;
2135 ON__UINT32 code_point
2143 const ON__UINT32 CodePoint()
const;
2145 bool IsEndOfLineCodePoint()
const;
2147 static bool IsEndOfLineCodePoint(
2148 ON__UINT32 unicode_code_point
2151 static bool IsCarriageReturnAndLineFeed(
2152 ON__UINT32 unicode_code_point,
2153 ON__UINT32 next_unicode_code_point
2171 static int CompareCodePointAndFont(
2219 static int GetGlyphList
2221 const wchar_t* text,
2223 ON__UINT32 unicode_CRLF_code_point,
2228 static int GetGlyphList
2230 size_t code_point_count,
2231 ON__UINT32* code_points,
2233 ON__UINT32 unicode_CRLF_code_point,
2258 static int GetGlyphListBoundingBox
2260 const wchar_t* text,
2265 static int GetGlyphListBoundingBox
2267 size_t code_point_count,
2268 ON__UINT32* code_points,
2283 ON__UINT32 code_point
2290 bool CodePointIsSet()
const;
2298 bool IsManaged()
const;
2332 bool bUseReplacementCharacter
2352 bool bIncludeCharMaps,
2375 bool TestFaceCharMaps(
2381 const ON__UINT_PTR FreeTypeFace()
const;
2393 const ON__UINT_PTR FontGlyphId()
const;
2419 bool GetGlyphContours(
2420 bool bSingleStrokeFont,
2427 static bool GetStringContours(
2428 const wchar_t* text_string,
2430 bool bSingleStrokeFont,
2432 double small_caps_scale,
2460 ON__UINT32 m_code_point = ON_UnicodeCodePoint::ON_InvalidCodePoint;
2462 ON__UINT8 m_is_managed = 0;
2463 ON__UINT8 m_reserved1 = 0;
2464 ON__UINT16 m_reserved2 = 0;
2465 ON__UINT_PTR m_font_glyph_id = 0;
2466 const class ON_Font* m_managed_font =
nullptr;
2471 void Internal_SetFontGlyphId(ON__UINT_PTR font_glyph_id);
2474 bool Internal_GetPlatformSubstitute(
2480 #if defined(ON_RUNTIME_WIN) 2488 bool ON_WindowsGetGlyphMetrics(
2490 ON__UINT32 unicode_code_point,
2499 #if defined(ON_DLL_TEMPLATE) Constants
miscellaneous constants use to initialize Windows LOGFONT fields
Definition: opennurbs_font.h:1423
friend class ON_Font
Definition: opennurbs_font.h:2389
Definition: opennurbs_ipoint.h:24
ON_UUID is a 16 byte universally unique identifier.
Definition: opennurbs_uuid.h:32
Weight
Weight enum values Avoid casting these values to int. Use ON_Font::WindowsLogfontWeightFromWeight() o...
Definition: opennurbs_font.h:237
Definition: opennurbs_font.h:1958
WindowsConstants
Definition: opennurbs_font.h:1379
static const ON_2iPoint Unset
Definition: opennurbs_ipoint.h:46
Definition: opennurbs_array.h:36
Stretch
Horizontal expansion or contraction of font
Definition: opennurbs_font.h:422
static const ON__UINT32 HeightOfCapitalCodePoint
Definition: opennurbs_font.h:44
Definition: opennurbs_sha1.h:19
ON_FontGlyph & operator=(const ON_FontGlyph &src)
Definition: opennurbs_internal_glyph.h:30
Definition: opennurbs_string.h:2020
const ON__UINT_PTR FreeTypeFace() const
Definition: opennurbs_point.h:277
static const double DefaultLineFeedRatio
Definition: opennurbs_font.h:37
Definition: opennurbs_font.h:2081
Definition: opennurbs_font.h:18
Definition: opennurbs_bounding_box.h:25
Definition: opennurbs_font.h:2039
Definition: opennurbs_internal_glyph.h:84
An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
Definition: opennurbs_font.h:225
void Dump(bool bIncludeCharMaps, ON_TextLog &text_log) const
static const ON_FontMetrics Unset
All properties are zero.
Definition: opennurbs_font.h:29
Definition: opennurbs_array.h:409
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
Style
Vertical angle of font Upright, Italic, or Oblique
Definition: opennurbs_font.h:467
Definition: opennurbs_point.h:839
Definition: opennurbs_point.h:1152
ContourPointType
Definition: opennurbs_font.h:2047