Skip to content

Map native:* font handles to installed iOS-family fonts in JavaSE simulator and add tests/docs#4708

Merged
liannacasper merged 2 commits intomasterfrom
codex/update-codename-one-simulator-fonts
Apr 6, 2026
Merged

Map native:* font handles to installed iOS-family fonts in JavaSE simulator and add tests/docs#4708
liannacasper merged 2 commits intomasterfrom
codex/update-codename-one-simulator-fonts

Conversation

@liannacasper
Copy link
Copy Markdown
Collaborator

Motivation

  • Improve fidelity of native:* font handling in the JavaSE simulator by selecting a real installed iOS-family font when running with an iOS skin.
  • Avoid attempting to distribute or hard-code Apple fonts and instead detect and prefer locally installed San Francisco / Helvetica Neue families when available.
  • Clarify simulator behavior and licensing implications in the docs so users know how to obtain exact iOS fonts if desired.

Description

  • Added a mapping IOS_NATIVE_FONT_CANDIDATES of native:* handles to ordered iOS-family font family name candidates and implemented detection of installed font families via getAvailableFontNamesLowercase().
  • Added helper utilities findFirstInstalledFontCandidate, nativeFontNameForIOS, and test helpers setAvailableFontNamesLowercaseForTest/clearAvailableFontNamesLowercaseForTest to control font detection in tests.
  • Modified nativeFontName and loadTrueTypeFont to return and use a real installed font on iOS simulator runs (and otherwise fall back to existing behavior), preserving cross-platform fallbacks.
  • Updated documentation to explain that Codename One does not bundle Apple iOS fonts, that the simulator prefers San Francisco/SF Pro (or Helvetica Neue) when installed, and added a FAQ entry with setup guidance for macOS/Windows/Linux.

Testing

  • Added maven/javase JUnit tests in JavaSEPortFontMappingTest covering findFirstInstalledFontCandidate, nativeFontNameForIOS behavior and loadTrueTypeFont fallbacks, and ran them under the JavaSE test profile; all tests passed.
  • The new tests exercised the installed-font detection logic and the simulator-path in loadTrueTypeFont and verified both positive and fallback flows.

Codex Task

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: 1 issue(s) flagged (1 errors) (exit code 1) (report)
  • Vale: 18579 alert(s) (2700 errors, 6345 warnings, 9534 suggestions) (exit code 1) (report)
  • Image references: 33 unused image(s) found (report)

Unused image preview:

  • img/uwp-app-manager-apps.png
  • img/uwp-certificate-generator.png
  • img/uwp-cn1settings-debug-desktop-selected.png
  • img/uwp-cn1settings-disk-icon.png
  • img/uwp-cn1settings-uwp.png
  • img/uwp-cn1settings-windows-settings-menu-item.png
  • img/uwp-dashboard-download-appxbundle.png
  • img/uwp-extract-zip-file.png
  • img/uwp-mobile-recently-added.png
  • img/uwp-mobile-settings-developer-mode.png
  • ... and 23 more

@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 6, 2026

Compared 35 screenshots: 35 matched.

Native Android coverage

  • 📊 Line coverage: 7.74% (3954/51097 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.11% (19607/321133), branch 2.88% (896/31161), complexity 3.61% (1077/29819), method 6.37% (886/13907), class 10.56% (195/1847)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 7.74% (3954/51097 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.11% (19607/321133), branch 2.88% (896/31161), complexity 3.61% (1077/29819), method 6.37% (886/13907), class 10.56% (195/1847)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Cloudflare Preview

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@liannacasper liannacasper linked an issue Apr 6, 2026 that may be closed by this pull request
@liannacasper liannacasper merged commit 089b9c4 into master Apr 6, 2026
18 checks passed
@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 6, 2026

Compared 35 screenshots: 35 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 195 seconds

Detailed Performance Metrics

Metric Duration
Simulator Boot 1000 ms
Simulator Boot (Run) 2000 ms
App Install 3000 ms
App Launch 10000 ms
Test Execution 168000 ms

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFE: improve consistency between simulator fonts and device fonts

2 participants