29INLINE
bool FreetypeFont::
30set_point_size(PN_stdfloat point_size) {
31 _point_size = point_size;
38INLINE PN_stdfloat FreetypeFont::
39get_point_size()
const {
54INLINE
bool FreetypeFont::
55set_pixels_per_unit(PN_stdfloat pixels_per_unit) {
56 _requested_pixels_per_unit = pixels_per_unit;
63INLINE PN_stdfloat FreetypeFont::
64get_pixels_per_unit()
const {
65 return _tex_pixels_per_unit;
73INLINE
bool FreetypeFont::
74set_pixel_size(PN_stdfloat pixel_size) {
75 return set_pixels_per_unit(pixel_size * _points_per_unit / _point_size);
81INLINE PN_stdfloat FreetypeFont::
82get_pixel_size()
const {
83 return _tex_pixels_per_unit * _point_size / _points_per_unit;
97INLINE
bool FreetypeFont::
98set_scale_factor(PN_stdfloat scale_factor) {
99 _requested_scale_factor = scale_factor;
100 return reset_scale();
106INLINE PN_stdfloat FreetypeFont::
107get_scale_factor()
const {
108 return _scale_factor;
121INLINE
void FreetypeFont::
122set_native_antialias(
bool native_antialias) {
123 _native_antialias = native_antialias;
130INLINE
bool FreetypeFont::
131get_native_antialias()
const {
132 return _native_antialias;
144INLINE
int FreetypeFont::
145get_font_pixel_size()
const {
146 return _pixel_height;
152INLINE PN_stdfloat FreetypeFont::
153get_line_height()
const {
160INLINE PN_stdfloat FreetypeFont::
161get_space_advance()
const {
162 return _space_advance;
169INLINE PN_stdfloat FreetypeFont::
170get_points_per_unit() {
171 return _points_per_unit;
178INLINE PN_stdfloat FreetypeFont::
179get_points_per_inch() {
180 return _points_per_inch;
189INLINE
void FreetypeFont::
190set_winding_order(WindingOrder winding_order) {
191 _winding_order = winding_order;
197INLINE FreetypeFont::WindingOrder FreetypeFont::
198get_winding_order()
const {
199 return _winding_order;
208INLINE FT_Face FreetypeFont::
209acquire_face()
const {
210 nassertr(_face !=
nullptr,
nullptr);
211 return _face->acquire_face(_char_size, _dpi, _pixel_width, _pixel_height);
218INLINE
void FreetypeFont::
219release_face(FT_Face face)
const {
220 nassertv(_face !=
nullptr);
221 _face->release_face(face);
227INLINE FreetypeFont::ContourPoint::
228ContourPoint(
const LPoint2 &p,
const LVector2 &in,
const LVector2 &out) :
229 _p(p), _in(in), _out(out), _radius(0)
236INLINE FreetypeFont::ContourPoint::
237ContourPoint(PN_stdfloat px, PN_stdfloat py, PN_stdfloat tx, PN_stdfloat ty) :
238 _p(px, py), _in(tx, ty), _out(tx, ty), _radius(0)
247INLINE
void FreetypeFont::ContourPoint::
248connect_to(
const LVector2 &out) {
250 if (_in.dot(_out) > 0.7071) {
252 LVector2 av = (_in + _out) * 0.5f;