Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Arial and Consolas as backup fonts on Linux and mention font name when one fails to load #994

Merged
merged 1 commit into from Jan 29, 2024

Conversation

zacharee
Copy link

Proposed Changes

One of the users of my Compose Multiplatform app ran into an issue where the app immediately crashed on Arch saying "could not load font". I couldn't reproduce it, but when they asked for the fonts Compose is looking for and I started looking into it, I realized they might not have the right fonts installed. After they installed DejaVu Sans, the app opened as normal.

This PR does a few things:

  • Adds "Arial" as a backup font for SansSerif.
  • Adds "Consolas" as a backup font for Monospace.
  • Expands on the "could not load font" error a bit to mention the font family and also indicate that the font might be missing from the system.

Testing

Test: Get a Linux GUI up and running without Noto Sans or DejaVu Sans installed, but with Arial installed. Build a Compose sample app and it should run using Arial. Remove Arial and the error thrown should now be more descriptive.

Issues Fixed

N/A

Google CLA

Signed

zacharee added a commit to zacharee/SamloaderKotlin that referenced this pull request Jan 16, 2024
@zacharee zacharee force-pushed the more-fallback-fonts-for-linux branch from 9edcf6e to c21736b Compare January 16, 2024 19:35
@zacharee zacharee force-pushed the more-fallback-fonts-for-linux branch from c21736b to a7fe61f Compare January 17, 2024 04:58
@igordmn igordmn merged commit 3e7e9ad into JetBrains:jb-main Jan 29, 2024
1 of 2 checks passed
MatkovIvan added a commit that referenced this pull request Jan 29, 2024
## Proposed Changes

- Fixed build error after #994

```
e: androidx/compose/ui/text/font/FontFamilyResolver.kt:261:5 Cannot find a parameter with this name: message
e: androidx/compose/ui/text/font/FontFamilyResolver.kt:262:5 Cannot find a parameter with this name: cause
```

## Testing

Test: CI should handle it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants