diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-07-02 08:05:04 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-07-02 09:53:38 +0200 |
commit | 037dce81fc27ec241edb6829f6df41927b80666e (patch) | |
tree | d337aa47b7447ad9e75f2ca6c6434b91e237cf9e /src/gui | |
parent | 9b36f48f59ceb1066cc215039c6d48224b8edd73 (diff) |
Support glyphs larger than 255x255 with Freetype engine
We used chars for the width and height of glyphs when caching
them in the Freetype engine. This was okay for Qt Widgets because
we would fall back to QPainterPath when the fonts were too big
anyway (though this has since become configurable).
But in Qt Quick, when NativeRendering is in use, we will always cache
glyphs, because they need to be uploaded to the GPU. Also 255 is
no longer a large font size with current screen sizes, so we need to
upgrade our maximum. The new maximum size is 65535x65535.
[ChangeLog][QtGui][Text] Fixed a bug where glyphs would be clipped
at very large sizes.
Fixes: QTBUG-85259
Pick-to: 5.15
Change-Id: I9a01a707b274e5f12e49c1b0bd58f743abae9f5e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qfontengine_p.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 524eaf32a7..a81e877677 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -123,13 +123,13 @@ public: }; Q_DECLARE_FLAGS(ShaperFlags, ShaperFlag) - /* Used with the Freetype font engine. We don't cache glyphs that are too large anyway, so we can make this struct rather small */ + /* Used with the Freetype font engine. */ struct Glyph { Glyph() = default; ~Glyph() { delete [] data; } short linearAdvance = 0; - unsigned char width = 0; - unsigned char height = 0; + unsigned short width = 0; + unsigned short height = 0; short x = 0; short y = 0; short advance = 0; |