Cleanup pass
Removed the getFontXHeight method from GfxRenderer interface. Updated documentation to clarify that getFontCapHeight returns the 'H' glyph height for optical alignment, and improved the comment for getTextVisualCenterOffset to be more concise.
This commit is contained in:
@@ -907,10 +907,9 @@ void GfxRenderer::drawIcon(const uint8_t bitmap[], const int x, const int y, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GfxRenderer::drawIcon(const freeink::Icon& icon, const int x, const int y, const bool black) const {
|
void GfxRenderer::drawIcon(const freeink::Icon& icon, const int x, const int y, const bool black) const {
|
||||||
// Orientation-correct blit: the bits are stored un-rotated, so each black pixel
|
// Bits are un-rotated, so each drawn pixel goes through drawPixel (which applies
|
||||||
// goes through drawPixel (which applies the current orientation transform). The
|
// the orientation transform) — correct in every orientation, unlike the legacy
|
||||||
// legacy uint8_t* overload above pre-rotates and is locked to one orientation;
|
// uint8_t* overload that pre-rotates for one orientation.
|
||||||
// freeink::Icon assets are correct in every orientation.
|
|
||||||
const int rowBytes = (icon.w + 7) / 8;
|
const int rowBytes = (icon.w + 7) / 8;
|
||||||
for (int row = 0; row < icon.h; ++row) {
|
for (int row = 0; row < icon.h; ++row) {
|
||||||
const uint8_t* r = icon.bits + static_cast<int>(row) * rowBytes;
|
const uint8_t* r = icon.bits + static_cast<int>(row) * rowBytes;
|
||||||
@@ -1574,9 +1573,8 @@ int GfxRenderer::getTextHeight(const int fontId) const {
|
|||||||
return fontIt->second.getData(EpdFontFamily::REGULAR)->ascender;
|
return fontIt->second.getData(EpdFontFamily::REGULAR)->ascender;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Height of a reference glyph above the baseline (glyph->top). 'H' gives the real
|
// Height of a reference glyph above the baseline (glyph->top): 'H' gives the real
|
||||||
// cap height, 'x' the x-height — the actual visible extents of the font, for
|
// cap height, the actual visible font extent for vertical centering.
|
||||||
// vertical centering that follows the font instead of a guessed ascender fraction.
|
|
||||||
int GfxRenderer::glyphTop(const int fontId, const uint32_t cp) const {
|
int GfxRenderer::glyphTop(const int fontId, const uint32_t cp) const {
|
||||||
const auto fontIt = fontMap.find(remapUiFont(fontId));
|
const auto fontIt = fontMap.find(remapUiFont(fontId));
|
||||||
if (fontIt == fontMap.end()) return 0;
|
if (fontIt == fontMap.end()) return 0;
|
||||||
@@ -1585,15 +1583,11 @@ int GfxRenderer::glyphTop(const int fontId, const uint32_t cp) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int GfxRenderer::getFontCapHeight(const int fontId) const { return glyphTop(fontId, 'H'); }
|
int GfxRenderer::getFontCapHeight(const int fontId) const { return glyphTop(fontId, 'H'); }
|
||||||
int GfxRenderer::getFontXHeight(const int fontId) const { return glyphTop(fontId, 'x'); }
|
|
||||||
|
|
||||||
int GfxRenderer::getTextVisualCenterOffset(const int fontId) const {
|
int GfxRenderer::getTextVisualCenterOffset(const int fontId) const {
|
||||||
// Distance from drawText's y (text top) down to the text's optical middle. The
|
// Cap-height middle: baseline is at top + ascender, caps reach capHeight above it,
|
||||||
// baseline is at y + ascender; the capitals reach capHeight above it, so the cap
|
// so the optical center is ascender - capHeight/2 below the top. Cap (not x) height
|
||||||
// middle is ascender - capHeight/2 below the top. Cap-height (not x-height): UI
|
// because UI labels are capital-led. Falls back to ascender*0.65 without an 'H'.
|
||||||
// labels are capital-led, so the eye centers on the caps — x-height sits a few px
|
|
||||||
// low. Falls back to ascender*0.65 if the 'H' glyph is missing. Scales with the
|
|
||||||
// font, so no per-size tweaking.
|
|
||||||
const int ascender = getFontAscenderSize(fontId);
|
const int ascender = getFontAscenderSize(fontId);
|
||||||
const int capHeight = getFontCapHeight(fontId);
|
const int capHeight = getFontCapHeight(fontId);
|
||||||
if (capHeight <= 0) return (ascender * 65) / 100;
|
if (capHeight <= 0) return (ascender * 65) / 100;
|
||||||
|
|||||||
@@ -225,13 +225,11 @@ class GfxRenderer {
|
|||||||
int getTextAdvanceX(int fontId, const char* text, EpdFontFamily::Style style) const;
|
int getTextAdvanceX(int fontId, const char* text, EpdFontFamily::Style style) const;
|
||||||
int getFontAscenderSize(int fontId) const;
|
int getFontAscenderSize(int fontId) const;
|
||||||
int getLineHeight(int fontId) const;
|
int getLineHeight(int fontId) const;
|
||||||
// Real visible font metrics (from the 'H' / 'x' glyph geometry) for vertical
|
// Cap height (from the 'H' glyph), the real visible font extent for vertical
|
||||||
// alignment that follows the font, not a guessed ascender fraction.
|
// alignment that follows the font instead of a guessed ascender fraction.
|
||||||
int getFontCapHeight(int fontId) const;
|
int getFontCapHeight(int fontId) const;
|
||||||
int getFontXHeight(int fontId) const;
|
// Offset from text top (drawText's y) to the text's optical center; align an
|
||||||
// Offset from drawText's y (text top) to the text's optical vertical center.
|
// element to a line via centerY = textTop + getTextVisualCenterOffset(fontId).
|
||||||
// Center any element (icon, etc.) on a line of text via:
|
|
||||||
// centerY = textTop + getTextVisualCenterOffset(fontId)
|
|
||||||
int getTextVisualCenterOffset(int fontId) const;
|
int getTextVisualCenterOffset(int fontId) const;
|
||||||
std::string truncatedText(int fontId, const char* text, int maxWidth,
|
std::string truncatedText(int fontId, const char* text, int maxWidth,
|
||||||
EpdFontFamily::Style style = EpdFontFamily::REGULAR) const;
|
EpdFontFamily::Style style = EpdFontFamily::REGULAR) const;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 32x32
|
|
||||||
static const uint8_t BookIcon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
|
|
||||||
0x07, 0xC0, 0x00, 0x00, 0x03, 0xCF, 0xFF, 0xF8, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF,
|
|
||||||
0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF,
|
|
||||||
0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3,
|
|
||||||
0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC,
|
|
||||||
0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xC3, 0xFF, 0xFC, 0x23, 0xE0, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x1F, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 24x24
|
|
||||||
static const uint8_t Book24Icon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x03, 0x80, 0x00, 0x01, 0x9F, 0xFF, 0x39,
|
|
||||||
0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39,
|
|
||||||
0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39, 0x9F, 0xFF, 0x39,
|
|
||||||
0x9F, 0xFF, 0x39, 0xC0, 0x00, 0x03, 0xE0, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 32x32
|
|
||||||
static const uint8_t BookmarkIcon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00,
|
|
||||||
0x03, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0F, 0x00,
|
|
||||||
0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x0F,
|
|
||||||
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 24x24
|
|
||||||
static const uint8_t File24Icon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 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0xE3, 0xFF, 0xFF, 0xCF, 0xE7, 0xFF, 0xFF, 0xCF, 0xE7, 0xFF, 0xFF, 0xCF, 0xE7, 0xFF, 0xFF,
|
|
||||||
0xCF, 0xE7, 0xFF, 0xFF, 0xCF, 0xE7, 0xFF, 0xFF, 0xCF, 0xE7, 0xFF, 0xFF, 0x8F, 0xE7, 0xFF, 0xFF, 0x8F, 0xF0, 0x00,
|
|
||||||
0x00, 0x1F, 0xF0, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 24x24
|
|
||||||
static const uint8_t Folder24Icon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x1F, 0xFC, 0x00, 0x0F, 0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7,
|
|
||||||
0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7, 0xF9, 0xFF, 0xE7,
|
|
||||||
0xF9, 0xFF, 0xE7, 0xF3, 0xFF, 0xE7, 0xE7, 0xFF, 0xE7, 0xCF, 0xFF, 0xE7, 0xCF, 0xFF, 0xE7, 0xCF, 0xFF, 0xE7,
|
|
||||||
0xCF, 0xFF, 0xE7, 0xCF, 0xFF, 0xE7, 0xCF, 0xFF, 0xE7, 0xE0, 0x00, 0x0F, 0xF0, 0x00, 0x1F, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 32x32
|
|
||||||
static const uint8_t HotspotIcon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF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xCF, 0xE7, 0xF3, 0xCF, 0xE3, 0xF3, 0xCF, 0xF1, 0xF3, 0xCF, 0xF8, 0xF3,
|
|
||||||
0xCF, 0x3C, 0x73, 0xCE, 0x1E, 0x33, 0xCC, 0xCF, 0x13, 0xCC, 0xCF, 0x83, 0xCE, 0x1F, 0xC3, 0xCF, 0x3F, 0xE3,
|
|
||||||
0xCF, 0xFF, 0xF3, 0xCF, 0xFF, 0xF3, 0xE0, 0x00, 0x07, 0xF0, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 32x32
|
|
||||||
static const uint8_t LibraryIcon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,
|
|
||||||
0x1F, 0xFF, 0xFF, 0xF0, 0x0F, 0xFF, 0xFF, 0xC1, 0xCF, 0xFF, 0xFE, 0x07, 0xE7, 0xFF, 0xF0, 0x3F, 0xE7, 0xFF, 0x81,
|
|
||||||
0xFF, 0x87, 0xFC, 0x0F, 0xFC, 0x0F, 0xF0, 0x3F, 0xF0, 0x3F, 0xE1, 0xFF, 0x81, 0xFF, 0xE7, 0xFC, 0x0F, 0xFF, 0xE7,
|
|
||||||
0xE0, 0x7F, 0xFF, 0xF3, 0x83, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x07, 0xE7, 0xFF, 0xFF, 0xE7,
|
|
||||||
0xE7, 0xFF, 0xFF, 0xE7, 0xE7, 0xFF, 0xFF, 0xE7, 0xE7, 0xFF, 0xFF, 0xE7, 0xE0, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00,
|
|
||||||
0x07, 0xE7, 0xFF, 0xFF, 0xE7, 0xE7, 0xFF, 0xFF, 0xE7, 0xE7, 0xFF, 0xFF, 0xE7, 0xE0, 0x00, 0x00, 0x07, 0xF0, 0x00,
|
|
||||||
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 32x32
|
|
||||||
static const uint8_t RecentIcon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
|
|
||||||
0x07, 0xC0, 0x00, 0x00, 0x03, 0xCF, 0xFF, 0xF8, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF,
|
|
||||||
0xFC, 0xF3, 0xC0, 0x03, 0xFC, 0xF3, 0xC0, 0x03, 0xFC, 0xF3, 0xCF, 0xC7, 0xFC, 0xF3, 0xCF, 0x8F, 0xFC, 0xF3, 0xCF,
|
|
||||||
0x1F, 0xFC, 0xF3, 0xCF, 0x8F, 0xFC, 0xF3, 0xCF, 0x87, 0xFC, 0xF3, 0xCF, 0xC3, 0xFC, 0xF3, 0xC0, 0x03, 0xFC, 0xF3,
|
|
||||||
0xC0, 0x03, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xCF, 0xFF, 0xFC,
|
|
||||||
0xF3, 0xCF, 0xFF, 0xFC, 0xF3, 0xC3, 0xFF, 0xFC, 0x23, 0xE0, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x1F, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF,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
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 24x24
|
|
||||||
static const uint8_t Text24Icon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x07, 0xF8, 0x00, 0x03, 0xF0, 0x7F, 0xF9,
|
|
||||||
0xE2, 0x7F, 0xF9, 0xC6, 0x73, 0x39, 0xCE, 0x73, 0x39, 0x80, 0x73, 0x39, 0x80, 0xF3, 0x39, 0x9F, 0xF3, 0x39,
|
|
||||||
0x9F, 0xF3, 0x39, 0x9F, 0x33, 0x39, 0x9F, 0x33, 0x39, 0x9F, 0x33, 0x39, 0x9F, 0x33, 0x39, 0x9F, 0xFF, 0xF9,
|
|
||||||
0x9F, 0xFF, 0xF9, 0xC0, 0x00, 0x03, 0xE0, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
// size: 32x32
|
|
||||||
static const uint8_t TransferIcon[] = {
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x3F, 0xFF, 0xFF, 0xFC, 0x3F, 0xFF, 0xFF, 0xF8, 0x3F,
|
|
||||||
0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0, 0x4F, 0xFF, 0xFF, 0xE2, 0x4F, 0xFF, 0xFF, 0xE2,
|
|
||||||
0x47, 0xFF, 0xFF, 0xC6, 0x67, 0xFF, 0xFF, 0xC6, 0x63, 0xFF, 0xFF, 0xCE, 0x73, 0xFF, 0xFF, 0x8E, 0x71, 0xFF, 0xFF,
|
|
||||||
0x9E, 0x79, 0xFF, 0xFF, 0x1E, 0x78, 0xFF, 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 0xFC, 0xF9, 0xF1, 0xFF, 0xFC, 0x7C, 0xFB, 0xFF, 0xFE, 0x7C, 0xFF, 0xFF, 0xFE, 0x7C, 0x7F,
|
|
||||||
0xFF, 0xFF, 0x3E, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xCF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
|
||||||
+4
-5
@@ -299,11 +299,10 @@ void setupDisplayAndFonts(bool seamless = false) {
|
|||||||
renderer.insertFont(UI_12_FONT_ID, ui12FontFamily);
|
renderer.insertFont(UI_12_FONT_ID, ui12FontFamily);
|
||||||
renderer.insertFont(SMALL_FONT_ID, smallFontFamily);
|
renderer.insertFont(SMALL_FONT_ID, smallFontFamily);
|
||||||
|
|
||||||
// UI chrome font scaling on high-density / touch boards: Ubuntu UI is only built
|
// UI chrome font scaling on touch/high-density boards: Ubuntu UI is only built at
|
||||||
// at 10/12pt, so remap the UI fonts up the Noto Sans ladder to grow chrome text
|
// 10/12pt, so remap the UI fonts up the Noto Sans ladder with uiScale. SMALL is
|
||||||
// with uiScale. SMALL is deliberately NOT remapped — it's secondary/compact text
|
// deliberately not remapped — it's compact secondary text (status bar, subtitles,
|
||||||
// (reader status bar, subtitles, battery %) that should stay small so reader
|
// battery %) that stays small. Reader body fonts aren't remapped either.
|
||||||
// chrome doesn't balloon. Reader body fonts aren't remapped either.
|
|
||||||
if (const float s = UITheme::uiScale(); s > 1.05f) {
|
if (const float s = UITheme::uiScale(); s > 1.05f) {
|
||||||
auto nearestNotoSans = [](float pt) -> int {
|
auto nearestNotoSans = [](float pt) -> int {
|
||||||
const struct {
|
const struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user