forked from Blendman974/faceclaw
Adapt layouts for Rayneo screen resolution
This commit is contained in:
1 parent
4d101eefe1
commit
dee60bbcd2
34 files changed
+721
-202
No files matched your search
@@ -3,6 +3,7 @@ import { installedFontPath } from "../../graphics/installed-fonts";
|
||||
import { wrapText } from "../../graphics/textwrap";
|
||||
import { TtfFont } from "../../graphics/ttf-font";
|
||||
import {
|
||||
defaultUiFontSize,
|
||||
fontSelectionLabel,
|
||||
getDefaultSmallFont,
|
||||
getUiFontSelection,
|
||||
@@ -25,8 +26,6 @@ const ROW_GAP = 2;
|
||||
const NOTE_GAP = 8;
|
||||
/** The sizes offered here; Settings has the full range. */
|
||||
const SIZE_CHOICES = FONT_SIZE_CHOICES.filter((size) => size >= 12 && size <= 18);
|
||||
/** Selected on the first visit, and marked. */
|
||||
const RECOMMENDED_SIZE = 16;
|
||||
const RECOMMENDED_NOTE = "Recommended";
|
||||
/** Drawn while they fit, so smaller sizes visibly show more words. */
|
||||
const PREVIEW_PARAGRAPHS = [
|
||||
@@ -41,7 +40,8 @@ type Face =
|
||||
| { kind: "fixed"; label: string };
|
||||
|
||||
/**
|
||||
* The UI font's size, 12 to 18px (16 recommended, and selected at first),
|
||||
* The UI font's size, 12 to 18px (the default size recommended, and
|
||||
* selected at first: 16px, or 14px on the RayNeo iO),
|
||||
* beside a preview of text in the selected size. The face and weight stay
|
||||
* as they are (they live in the Settings font picker); a bitmap face has
|
||||
* only one size, so the page just says so. The size is saved on tap, not
|
||||
@@ -67,7 +67,7 @@ export class TextSizePage implements OnboardingPage {
|
||||
if (sizes.length) {
|
||||
this.face = { kind: "sized", file: selection.file, path, sizes };
|
||||
// The recommended size the first time; on a return, what was left selected.
|
||||
this.sizeMenu.setItems(sizes, nearestIndex(sizes, this.sizeMenu.selectedItem ?? RECOMMENDED_SIZE));
|
||||
this.sizeMenu.setItems(sizes, nearestIndex(sizes, this.sizeMenu.selectedItem ?? defaultUiFontSize()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ export class TextSizePage implements OnboardingPage {
|
||||
const body = onboardingFont("body");
|
||||
const label = sizeLabel(size);
|
||||
image.drawText(body, x + 10, y + LIST_ROW_TEXT_INSET, label, selected ? 255 : 190);
|
||||
if (size !== RECOMMENDED_SIZE) return;
|
||||
if (size !== defaultUiFontSize()) return;
|
||||
const detail = onboardingFont("detail");
|
||||
const noteY = y + Math.round((height - detail.lineHeight) / 2);
|
||||
image.drawText(detail, x + 10 + body.measureText(label) + NOTE_GAP, noteY, RECOMMENDED_NOTE, selected ? 210 : 150);
|
||||
|
||||
Reference in new issue
Block a user