1,295
edits
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
void SetFont(nsFont* font, nsIAtom* language); | void SetFont(nsFont* font, nsIAtom* language); | ||
enum { ClusterStart = 0x1 } CharFlags; | enum { ClusterStart = 0x1 } CharFlags; | ||
// ClusterStart: character is the first character of a cluster/glyph | // ClusterStart: character is the first character of a cluster/glyph | ||
void GetCharacterFlags(int pos, int len, CharFlags* flags); | void GetCharacterFlags(int pos, int len, CharFlags* flags); | ||
struct Dimensions { | struct Dimensions { | ||
double ascent, descent, width, leftBearing, rightBearing; | double ascent, descent, width, leftBearing, rightBearing; | ||
}; | }; | ||
Dimensions MeasureText(int pos, int len); | Dimensions MeasureText(int pos, int len); | ||
// Compute how many characters from this string starting at | // Compute how many characters from this string starting at | ||
// character 'pos' and up to length 'len' fit | // character 'pos' and up to length 'len' fit | ||
| Line 24: | Line 24: | ||
// the implementor could optimize for that. | // the implementor could optimize for that. | ||
int GetCharsFit(int pos, int len, double width, int breakflags); | int GetCharsFit(int pos, int len, double width, int breakflags); | ||
int GetPositionInString(Point pt); | int GetPositionInString(Point pt); | ||
}; | }; | ||
For Graphics we can have something like this | |||
// Assumes that the whole TextRun is to be drawn at the current | |||
// position, and renders a substring of it. | |||
DrawString(TextRun text, int pos, int len); | |||
edits