summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/skia/fx_skia_device.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 0bdf3f8b7b..ab026f6cc4 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -159,6 +159,7 @@ void RgbByteOrderTransferBitmap(const CFX_RetainPtr<CFX_DIBitmap>& pBitmap,
#define SHOW_SKIA_PATH_SHORTHAND 0 // set to 1 for abbreviated path contents
#endif
#define DRAW_SKIA_CLIP 0 // set to 1 to draw a green rectangle around the clip
+#define SHOW_TEXT_GLYPHS 0 // set to 1 to print unichar equivalent of glyph
#if SHOW_SKIA_PATH
void DebugShowSkiaPaint(const SkPaint& paint) {
@@ -837,6 +838,14 @@ class SkiaState {
#ifdef _SKIA_SUPPORT_PATHS_
m_pDriver->PreMultiply();
#endif // _SKIA_SUPPORT_PATHS_
+#if SHOW_TEXT_GLYPHS
+ SkTDArray<SkUnichar> text;
+ text.setCount(m_glyphs.count());
+ skPaint.glyphsToUnichars(m_glyphs.begin(), m_glyphs.count(), text.begin());
+ for (size_t i = 0; i < m_glyphs.count(); ++i)
+ printf("%lc", m_glyphs[i]);
+ printf("\n");
+#endif
skCanvas->drawPosText(m_glyphs.begin(), m_glyphs.count() * 2,
m_positions.begin(), skPaint);
skCanvas->restore();
@@ -1450,6 +1459,14 @@ bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars,
positions[index] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip};
glyphs[index] = static_cast<uint16_t>(cp.m_GlyphIndex);
}
+#if SHOW_TEXT_GLYPHS
+ SkTDArray<SkUnichar> text;
+ text.setCount(glyphs.count());
+ paint.glyphsToUnichars(glyphs.begin(), glyphs.count(), text.begin());
+ for (size_t i = 0; i < glyphs.count(); ++i)
+ printf("%lc", text[i]);
+ printf("\n");
+#endif
#ifdef _SKIA_SUPPORT_PATHS_
m_pBitmap->PreMultiply();
#endif // _SKIA_SUPPORT_PATHS_