opennurbs_freetype.h
1 /*
2 //
3 // Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved.
4 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
5 // McNeel & Associates.
6 //
7 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
8 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
9 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
10 //
11 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
12 //
13 ////////////////////////////////////////////////////////////////
14 */
15 
16 #if !defined(OPENNURBS_FREETYPE_INC_)
17 #define OPENNURBS_FREETYPE_INC_
18 
19 #if defined(ON_COMPILER_MSC)
20 //&& defined(ON_64BIT_RUNTIME)
21 // freetype is not delivered in a 32-bit version.
22 // To disable freetype support, comment out the following define.
23 // To enable freetype support, define OPENNURBS_FREETYPE_SUPPORT
24 
25 #define OPENNURBS_FREETYPE_SUPPORT
26 
27 #elif defined(ON_RUNTIME_APPLE)
28 // To disable freetype support, comment out the following define.
29 // To enable freetype support, define OPENNURBS_FREETYPE_SUPPORT
30 
31 #define OPENNURBS_FREETYPE_SUPPORT
32 
33 #endif
34 
35 /*
36 Parameters:
37  font_unit_font_metrics - [in]
38  metrics in font units (freetype face loaded with FT_LOAD_NO_SCALE) unless
39  it is a "tricky" font.
40 */
41 ON_DECL
42 void ON_FreeTypeGetFontMetrics(
43  const ON_Font* font,
44  ON_FontMetrics& font_unit_font_metrics
45  );
46 
47 /*
48 Parameters:
49  font_unit_glyph_box - [in]
50  box in font units (freetype face loaded with FT_LOAD_NO_SCALE) unless
51  it is a "tricky" font.
52 Returns:
53  0 if box was not set.
54  >0: font glyph id (or other non-zero value) when box is set
55 */
56 ON_DECL
57 ON__UINT_PTR ON_FreeTypeGetGlyphMetrics(
58  const ON_Font* font,
59  ON__UINT32 unicode_code_point,
60  class ON_TextBox& font_unit_glyph_box
61 );
62 
63 ON_DECL
64 bool ON_FreeTypeGetGlyphOutline(
65  const ON_FontGlyph* glyph,
66  bool bSingleStrokeFont,
67  double text_height,
69  ON_BoundingBox* glyph_bbox,
70  ON_3dVector* glyph_advance
71 );
72 
73 /*
74 Description:
75  A wrapper for calculating parameters and calling FreeType library
76  functions FT_Set_Char_Size() FT_Load_Glyph().
77 Parameters:
78  ft_face - [in]
79  A pointer to and FT_Face. One way to get this value is to call ON_Font::FreeTypeFace()
80  font_glyph_id - [in]
81  font glyph id
82 Returns:
83  True if glyph is available and loaded.
84 */
85 ON_DECL
86 bool ON_FreeTypeLoadGlyph(
87  ON__UINT_PTR ft_face,
88  ON__UINT_PTR font_glyph_id,
89  bool bLoadRenderBitmap
90 );
91 
92 
93 #endif
Definition: opennurbs_font.h:1958
Definition: opennurbs_font.h:2081
Definition: opennurbs_font.h:18
Definition: opennurbs_bounding_box.h:25
An ON_Font is a face in a font family. It corresponds to a Windows LOGFONT, a .NET System...
Definition: opennurbs_font.h:225
Definition: opennurbs_array.h:409
Definition: opennurbs_point.h:1152