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

Game's font is not displayed when running game on old devices #205

Open
mrfatguy opened this issue Jun 3, 2024 · 0 comments
Open

Game's font is not displayed when running game on old devices #205

mrfatguy opened this issue Jun 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mrfatguy
Copy link
Contributor

mrfatguy commented Jun 3, 2024

When running game (both web version and mobile version) on some older device, we don't have our game's font displayed at all and font substitution (i.e. to Times New Roman etc.) walks in.

Our initial research had revealed that this could potentially be caused by the fact that the source code references .woff2 font file only and does not reference .otf, .ttf and .woff files:

@font-face {
    font-family: 'Lost Pixelized Font';
    src: url('lpf.woff2') format('woff2');
    font-style: normal;
    font-weight: normal;
    text-rendering: optimizeLegibility;
}

Old browsers doesn't recognize .woff2 fonts formats and must be pointed out to either .woff, .otf or .ttf:

/* Webfont: Lost Pixelized Font-Regular */
@font-face {
    font-family: 'LostPixelizedFont';
    src: url('Lost Pixelized Font.woff2') format('woff2'), /* Safari, Android, iOS */
         url('Lost Pixelized Font.woff') format('woff'), /* Modern Browsers */
         url('Lost Pixelized Font.otf') format('opentype'), /* Modern Browsers */
         url('Lost Pixelized Font.ttf') format('truetype'); /* IE6-IE9 */
    font-style: normal;
    font-weight: normal;
    text-rendering: optimizeLegibility;
}

But, please, double check, if this is truly the cause of this bug.

Please, make sure that you test this on devices that doesn't have .ttf font installed in Windows. Otherwise your results might be inconclusive, because browsers on Windows displays fonts directly from installed .ttf or .otf files completely ignoring CSS styles.

You can have entire @font-face section removed from above stylesheet and still see correct font in game or page.

@mrfatguy mrfatguy added the bug Something isn't working label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants