42 lines
1.7 KiB
Diff
42 lines
1.7 KiB
Diff
From feca2661444f0d615f8c050fed4d79acffb42890 Mon Sep 17 00:00:00 2001
|
|
From: Danny Lin <danny@kdrag0n.dev>
|
|
Date: Tue, 5 Oct 2021 21:01:50 -0700
|
|
Subject: [PATCH 14/15] Paint: Enable subpixel text positioning by default
|
|
|
|
On desktop Linux, subpixel text positioning is necessary to avoid
|
|
kerning issues, and Android is no different. Even though most phone
|
|
displays have relatively high DPIs, the lack of subpixel text
|
|
positioning is only unnoticeable on high-end devices such as the Pixel 4
|
|
XL (1440x3040 @ 6.3 in => 537 dpi).
|
|
|
|
For example, on the Pixel 5 (1080 x 2340 @ 6.0 in => 432 dpi),
|
|
horizontally-scrolling labels in QS tiles can be seen "jittering"
|
|
slightly upon close observation. This was tested with the Google Sans
|
|
font on Google's stock OS. At this lower DPI, there is still a need for
|
|
subpixel text positioning (at least in some cases).
|
|
|
|
Enable subpixel text positioning by default to fix occasional kerning
|
|
issues and jittering when text is in motion.
|
|
|
|
Change-Id: I8d71e5848a745c5a2d457a28c68458920928ee09
|
|
---
|
|
graphics/java/android/graphics/Paint.java | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
|
|
index 451b99ea7550..e60d506a171b 100644
|
|
--- a/graphics/java/android/graphics/Paint.java
|
|
+++ b/graphics/java/android/graphics/Paint.java
|
|
@@ -253,7 +253,7 @@ public class Paint {
|
|
|
|
// These flags are always set on a new/reset paint, even if flags 0 is passed.
|
|
static final int HIDDEN_DEFAULT_PAINT_FLAGS = DEV_KERN_TEXT_FLAG | EMBEDDED_BITMAP_TEXT_FLAG
|
|
- | FILTER_BITMAP_FLAG;
|
|
+ | FILTER_BITMAP_FLAG | SUBPIXEL_TEXT_FLAG;
|
|
|
|
/**
|
|
* Font hinter option that disables font hinting.
|
|
--
|
|
2.25.1
|
|
|