1919
2020// //////////////////////////////////////////////////////////////////
2121// Function: DynamicTextFont::get_name
22- // Access: Public
22+ // Access: Published
2323// Description: Disambiguates the get_name() method between that
2424// inherited from TextFont and that inherited from
2525// FreetypeFont.
@@ -127,9 +127,61 @@ get_scale_factor() const {
127127 return FreetypeFont::get_scale_factor ();
128128}
129129
130+ // //////////////////////////////////////////////////////////////////
131+ // Function: DynamicTextFont::set_native_antialias
132+ // Access: Published
133+ // Description: Sets whether the Freetype library's built-in
134+ // antialias mode is enabled. There are two unrelated
135+ // ways to achieve antialiasing: with Freetype's native
136+ // antialias mode, and with the use of a scale_factor
137+ // greater than one. By default, both modes are
138+ // enabled.
139+ //
140+ // At low resolutions, some fonts may do better with one
141+ // mode or the other. In general, Freetype's native
142+ // antialiasing will produce less blurry results, but
143+ // may introduce more artifacts.
144+ // //////////////////////////////////////////////////////////////////
145+ INLINE void DynamicTextFont::
146+ set_native_antialias (bool native_antialias) {
147+ // If this assertion fails, you didn't call clear() first. RTFM.
148+ nassertv (get_num_pages () == 0 );
149+
150+ FreetypeFont::set_native_antialias (native_antialias);
151+ }
152+
153+ // //////////////////////////////////////////////////////////////////
154+ // Function: DynamicTextFont::get_native_antialias
155+ // Access: Published
156+ // Description: Returns whether Freetype's built-in antialias mode is
157+ // enabled. See set_native_antialias().
158+ // //////////////////////////////////////////////////////////////////
159+ INLINE bool DynamicTextFont::
160+ get_native_antialias () const {
161+ return FreetypeFont::get_native_antialias ();
162+ }
163+
164+ // //////////////////////////////////////////////////////////////////
165+ // Function: DynamicTextFont::get_font_pixel_size
166+ // Access: Published
167+ // Description: This is used to report whether the requested pixel
168+ // size is being only approximated by a fixed-pixel-size
169+ // font. This returns 0 in the normal case, in which a
170+ // scalable font is used, or the fixed-pixel-size font
171+ // has exactly the requested pixel size.
172+ //
173+ // If this returns non-zero, it is the pixel size of the
174+ // font that we are using to approximate our desired
175+ // size.
176+ // //////////////////////////////////////////////////////////////////
177+ INLINE int DynamicTextFont::
178+ get_font_pixel_size () const {
179+ return FreetypeFont::get_font_pixel_size ();
180+ }
181+
130182// //////////////////////////////////////////////////////////////////
131183// Function: DynamicTextFont::get_line_height
132- // Access: Public
184+ // Access: Published
133185// Description: Returns the number of units high each line of text
134186// is.
135187// //////////////////////////////////////////////////////////////////
@@ -140,7 +192,7 @@ get_line_height() const {
140192
141193// //////////////////////////////////////////////////////////////////
142194// Function: DynamicTextFont::get_space_advance
143- // Access: Public
195+ // Access: Published
144196// Description: Returns the number of units wide a space is.
145197// //////////////////////////////////////////////////////////////////
146198INLINE float DynamicTextFont::
0 commit comments