diff options
author | Raph Levien <raph@google.com> | 2014-09-03 10:37:05 -0700 |
---|---|---|
committer | Raph Levien <raph@google.com> | 2014-09-03 10:42:52 -0700 |
commit | 6740536e3927d25bf5c2567e5f6e8c175973cbb7 (patch) | |
tree | 65688d617f54510ba27c8688f89af4ddf2c0f5ef /include/minikin/MinikinFont.h | |
parent | 997c799e3ec6bf8adf687e29670d23d91e0f5fee (diff) | |
download | android_frameworks_minikin-6740536e3927d25bf5c2567e5f6e8c175973cbb7.tar.gz android_frameworks_minikin-6740536e3927d25bf5c2567e5f6e8c175973cbb7.tar.bz2 android_frameworks_minikin-6740536e3927d25bf5c2567e5f6e8c175973cbb7.zip |
Snap advance widths to integers
Fractional advance widths were causing subtle problems with text
positioning when the same text was drawn with different spans in the
hwui renderer. Quantizing the coordinates on layout (as opposed to
waiting until the renderer draws the glyphs) solves the problem.
This patch also fixes a discrepancy between x position and advance
widths when letterspacing.
Bug: 17347779
Change-Id: Ia705944047408c2839d5ad078eefd6bbec446872
Diffstat (limited to 'include/minikin/MinikinFont.h')
-rw-r--r-- | include/minikin/MinikinFont.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/minikin/MinikinFont.h b/include/minikin/MinikinFont.h index 9b25f92..3f07589 100644 --- a/include/minikin/MinikinFont.h +++ b/include/minikin/MinikinFont.h @@ -49,6 +49,12 @@ struct MinikinPaint { std::string fontFeatureSettings; }; +// Only a few flags affect layout, but those that do should have values +// consistent with Android's paint flags. +enum MinikinPaintFlags { + LinearTextFlag = 0x40, +}; + struct MinikinRect { float mLeft, mTop, mRight, mBottom; bool isEmpty() const { |