31 class re_FontInstance;
56 enum { BUFFER_CHUNK_SIZE = 4096 };
66 : myP(nullptr), myUV(nullptr), myCd(nullptr),
67 myNext(nullptr), myArraySize(0),
82 myOwnFontBuffers(false)
97 bool myOwnFontBuffers;
105 static RE_Font &
get(
const char *font_name,
float size);
106 static RE_Font &
get(RE_Font &font,
FONT_Variant variant);
107 static RE_Font &emptyFont();
134 float getDescender();
146 float getUnderlinePos();
150 float getUnderlineThickness();
153 bool hasGlyph(
utf32 cp);
159 float getHorizAdvance(
utf32 cp);
163 float getHorizAdvance(
utf32 cp,
utf32 cp_next);
166 float getStringWidth(
const utf8 *
s,
const utf8 *e =
nullptr,
171 return getStringWidth(str.
begin(), str.
end(), cp_xform);
176 return getStringWidth(str.
c_str(),
nullptr, cp_xform);
181 return getStringWidth(str.
begin(), str.
end(), cp_xform);
186 return getStringWidth(str.
begin(), str.
end(), cp_xform);
196 return isStringWiderThan(str.
begin(), str.
end(),
width, cp_xform);
201 bool getTrimmedString(
const utf8 *&
s,
const utf8 *&e,
const utf8 *ellipsis,
202 float max_width,
bool trim_right,
204 float *trimmed_width =
nullptr);
225 float max_width,
float max_height = FLT_MAX,
244 bool use_shared_font_buffers);
247 float getIntegerWidth(
const char*
s );
250 float getFloatWidth(
const char*
s );
255 RE_Font(
const FONT_Info &font_info,
float size,
const PassKey &);
256 RE_Font(RE_Font &
ref,
float scale,
const PassKey &);
261 RE_Font &fallbackFontForCodepoint(
utf32 cp);
264 bool splitStringImpl(
271 re_FontInstance *myInstance;
282 friend class re_FontCache;
SYS_FORCE_INLINE const_iterator begin() const
float getStringWidth(const UT_StringView &str, const UT_Unicode::transform *cp_xform=nullptr)
The size, in points, of this font.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
float getSize() const
Get the size, in points, of this font.
SYS_NO_DISCARD_RESULT SYS_FORCE_INLINE const_iterator end() const
Returns a constant iterator pointing to the end of the string.
**But if you need a result
const char * c_str() const
SYS_FORCE_INLINE const_iterator end() const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
GA_API const UT_StringHolder scale
A utility class to do read-only operations on a subset of an existing string.
SYS_FORCE_INLINE const char * end() const
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
SYS_FORCE_INLINE const char * begin() const
Iterator compatibility.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
RE_FontBuffers(int bucket)
GLsizei const GLchar *const * strings
RE_StringSplitType
Specifies which method to use to split string in RE_Font::splitString.
bool operator!=(const RE_Font &other) const
SYS_NO_DISCARD_RESULT SYS_FORCE_INLINE const_iterator begin() const
Returns a constant iterator pointing to the beginning of the string.
float getStringWidth(const UT_StringRef &str, const UT_Unicode::transform *cp_xform=nullptr)
The size, in points, of this font.
float getStringWidth(const UT_String &str, const UT_Unicode::transform *cp_xform=nullptr)
The size, in points, of this font.
const FONT_Info & getFontInfo() const
float getStringWidth(const UT_WorkBuffer &str, const UT_Unicode::transform *cp_xform=nullptr)
The size, in points, of this font.
MX_CORE_API StringVec splitString(const string &str, const string &sep)
bool isStringWiderThan(const UT_StringView &str, float width, const UT_Unicode::transform *cp_xform=nullptr)
The size, in points, of this font.