mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[escher/run_loop] Move kandinksy include
To check whether an ExternalText could be written with Epsilon's fonts, UTF8Helper made a reference to Kandinsky, which is prohibited. This check is now done in Escher, before dispatching the event. Change-Id: I55e9db1ba43c3115775499db47b90a6bdd7cc7b3
This commit is contained in:
committed by
Émilie Feral
parent
d5e810f2b8
commit
0185e0562c
@@ -33,6 +33,8 @@ public:
|
||||
static constexpr const KDFont * LargeFont = &privateLargeFont;
|
||||
static constexpr const KDFont * SmallFont = &privateSmallFont;
|
||||
|
||||
static bool CanBeWrittenWithGlyphs(const char * text);
|
||||
|
||||
KDSize stringSize(const char * text, int textLength = -1) const {
|
||||
return stringSizeUntil(text, textLength < 0 ? nullptr : text + textLength);
|
||||
}
|
||||
|
||||
@@ -159,3 +159,17 @@ KDFont::GlyphIndex KDFont::indexForCodePoint(CodePoint c) const {
|
||||
return IndexForReplacementCharacterCodePoint;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool KDFont::CanBeWrittenWithGlyphs(const char * text) {
|
||||
UTF8Decoder decoder(text);
|
||||
CodePoint cp = decoder.nextCodePoint();
|
||||
while(cp != UCodePointNull) {
|
||||
if (LargeFont->indexForCodePoint(cp) == KDFont::IndexForReplacementCharacterCodePoint
|
||||
|| SmallFont->indexForCodePoint(cp) == KDFont::IndexForReplacementCharacterCodePoint)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cp = decoder.nextCodePoint();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user