17 #ifndef _ufontmetrics_hpp_ 18 #define _ufontmetrics_hpp_ 1 35 void set(
const UFontDesc&, UDisp* = null);
37 float getAscent()
const;
38 float getDescent()
const;
39 float getHeight()
const;
41 float getWidth(
char)
const;
42 float getWidth(
const UStr&)
const;
43 float getWidth(
const UStr&,
int from_char,
int len = -1)
const;
44 float getWidth(
const char* str,
int str_len = -1)
const;
46 int getCharPos(
const char* str,
int str_len,
float x)
const;
49 float getXPos(
const char* str,
int str_len,
int char_pos)
const;
53 int& s_sublen,
int& change_line)
const;
66 const char* str,
int str_len,
67 float x0,
float y0,
int& charpos_begin,
int& charpos_end,
68 float& xpos_begin,
float& xpos_end);
2D Dimension.
Definition: ugeom.hpp:55
[Impl] Native Font.
Definition: uhardfont.hpp:35
Display Context.
Definition: udisp.hpp:44
int getCharPos(const char *str, int str_len, float x) const
converts x pos to char pos.
Definition: ufontmetrics.cpp:145
[impl] Internal representation for fonts.
Definition: ufontImpl.hpp:24
static bool getClippedText(const UHardFont *, float clip_x, float clip_width, const char *str, int str_len, float x0, float y0, int &charpos_begin, int &charpos_end, float &xpos_begin, float &xpos_end)
returns the substring that is enclosed in the current clip.
Definition: ufontmetrics.cpp:243
Font of a UElem or UBox container.
Definition: ufont.hpp:30
Definition: uupdatecontext.hpp:32
Definition: uhardfont.hpp:31
float getXPos(const char *str, int str_len, int char_pos) const
converts char pos to x pos.
Definition: ufontmetrics.cpp:170
Definition: ufontmetrics.hpp:21
bool getSubTextSize(const char *s, int s_len, UDimension &, float available_width, int &s_sublen, int &change_line) const
returns font metrics of a substring that verifies certain conditions.
Definition: ufontmetrics.cpp:187
Ubit String.
Definition: ustr.hpp:72