mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[kandinsky] Add KDCodePoint prefix static code points
This commit is contained in:
@@ -16,8 +16,8 @@ private:
|
||||
uint32_t m_code;
|
||||
};
|
||||
|
||||
static constexpr CodePoint Null = 0x0;
|
||||
static constexpr CodePoint Tabulation = 0x9;
|
||||
static constexpr CodePoint LineFeed = 0xA;
|
||||
static constexpr CodePoint KDCodePointNull = 0x0;
|
||||
static constexpr CodePoint KDCodePointTabulation = 0x9;
|
||||
static constexpr CodePoint KDCodePointLineFeed = 0xA;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,11 +14,11 @@ KDPoint KDContext::drawString(const char * text, KDPoint p, const KDFont * font,
|
||||
|
||||
UTF8Decoder decoder(text);
|
||||
CodePoint codePoint = decoder.nextCodePoint();
|
||||
while (codePoint != Null) {
|
||||
if (codePoint == LineFeed) {
|
||||
while (codePoint != KDCodePointNull) {
|
||||
if (codePoint == KDCodePointLineFeed) {
|
||||
position = KDPoint(0, position.y() + glyphSize.height());
|
||||
codePoint = decoder.nextCodePoint();
|
||||
} else if (codePoint == Tabulation) {
|
||||
} else if (codePoint == KDCodePointTabulation) {
|
||||
position = position.translatedBy(KDPoint(k_tabCharacterWidth * glyphSize.width(), 0));
|
||||
codePoint = decoder.nextCodePoint();
|
||||
} else {
|
||||
|
||||
@@ -13,12 +13,12 @@ KDSize KDFont::stringSize(const char * text) const {
|
||||
|
||||
UTF8Decoder decoder(text);
|
||||
CodePoint codePoint = decoder.nextCodePoint();
|
||||
while (codePoint != Null) {
|
||||
while (codePoint != KDCodePointNull) {
|
||||
KDSize cSize = KDSize(m_glyphSize.width(), 0);
|
||||
if (codePoint == LineFeed) {
|
||||
if (codePoint == KDCodePointLineFeed) {
|
||||
cSize = KDSize(0, m_glyphSize.height());
|
||||
codePoint = decoder.nextCodePoint();
|
||||
} else if (codePoint == Tabulation) {
|
||||
} else if (codePoint == KDCodePointTabulation) {
|
||||
cSize = KDSize(k_tabCharacterWidth*m_glyphSize.width(), 0);
|
||||
} else if (codePoint.isCombining()) {
|
||||
cSize = KDSizeZero;
|
||||
|
||||
Reference in New Issue
Block a user