summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-09-03 10:37:05 -0700
committerRaph Levien <raph@google.com>2014-09-03 10:42:52 -0700
commit6740536e3927d25bf5c2567e5f6e8c175973cbb7 (patch)
tree65688d617f54510ba27c8688f89af4ddf2c0f5ef /include
parent997c799e3ec6bf8adf687e29670d23d91e0f5fee (diff)
downloadandroid_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')
-rw-r--r--include/minikin/MinikinFont.h6
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 {