GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(android): map font-weight to the wght axis for custom fonts on API 26+ by aleclarson · Pull Request #11514 · NativeScript/NativeScript

Conversation

@aleclarson

@aleclarson aleclarson commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for — fix(core): Android font-weight is ignored for custom fonts on API 26+ (no wght axis mapping) #11513.
  • You have signed the CLA.
  • All existing tests are passing — npx vitest run ui/styling/font.android.spec.ts (6/6); the new spec fails 4 of 6 cases against unpatched font.android.ts.
  • Tests for the changes are included — packages/core/ui/styling/font.android.spec.ts.

What is the current behavior?

On Android API 26+, custom fonts loaded from files ignore CSS font-weight: loadFontFromFile passes only explicit font-variation-settings to Typeface.Builder.setFontVariationSettings, so a variable font with font-weight: 700 renders at its default weight. computeFontCacheKey also omits the weight, so two weights of the same family would collide in the typeface cache. And if a font doesn't support the wght axis, builder.build() throws with no retry — the file load fails outright.

What is the new behavior?

  • A wght axis entry derived from fontWeight (getNumericFontWeight) is appended to the variation settings unless the caller set wght explicitly — explicit settings always win.
  • fontWeight joins the typeface cache key, so weights of one family cache independently.
  • If the augmented build throws, the load retries once with the caller's explicit settings (fonts that lack the wght axis still load). If the caller did request wght explicitly, the error propagates to the outer catch as before and the font falls back to the default typeface — no retry of a request the caller made.

Fixes #11513

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aleclarson
fix(android): map font-weight to the wght axis for custom fonts on AP…
f2843f7
…I 26+

Variable fonts loaded from files ignored CSS font-weight: the Typeface
Builder received only explicit font-variation-settings, so font-weight: 700
rendered at the font's default weight. The typeface cache key also lacked
the weight, so two weights of the same family would collide once the axis
is honored.

Inject a wght axis entry derived from fontWeight unless the caller set wght
explicitly, include fontWeight in the cache key, and retry with the
caller's explicit settings when the augmented build throws (font lacking
the wght axis).

Closes NativeScript#11513
@nx-cloud

nx-cloud Bot commented Oct 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit f2843f7

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 20s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-08 01:49:12 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11514
npm i https://pkg.pr.new/@nativescript/vite@11514
npm i https://pkg.pr.new/@nativescript/webpack@11514

commit: f2843f7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aleclarson added a commit to octane-xplat/octane-xplat that referenced this pull request Oct 8, 2026
@aleclarson
docs(cli): record upstream PRs for patch-only fixes
a2aa6aa
Filed upstream PRs for the five patch-audit fixes and recorded them via a
new upstreamPR field on the manifest entries:

- nativescript-community/octane#14 — setProp undefined-skip, visibility
  capability, intrinsic ref types
- nativescript-community/octane#15 — vite-octane .tsrx HMR matching and
  recipients counting
- nativescript-community/ui-image#69 — iOS prefetch cacheType + headers
- nfrasser/linkifyjs#572 — ICU-free \p{} regex construction
- meta/lexical#9334 — @lexical/link URL_REGEX via new RegExp
- NativeScript/NativeScript#11514 — font-weight → wght axis mapping on
  Android (issue #11513)
@aleclarson aleclarson mentioned this pull request Nov 6, 2026
iOS variable fonts ignore computed font-weight and normal weight defaults #11618
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fix(core): Android font-weight is ignored for custom fonts on API 26+ (no wght axis mapping)

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@aleclarson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.