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

Source Code Pro TTF font breaks syntax highlighting #1836

Closed
mabuchner opened this issue May 27, 2020 · 3 comments
Closed

Source Code Pro TTF font breaks syntax highlighting #1836

mabuchner opened this issue May 27, 2020 · 3 comments
Labels
A-font Area: Font loading and rendering bug Something isn't working

Comments

@mabuchner
Copy link

mabuchner commented May 27, 2020

I'm trying to use the Source Code Pro TTF font from here:

https://github.com/adobe-fonts/source-code-pro/tree/release/TTF

{
  // ...
  "editor.fontFamily": "Source Code Pro",
  "editor.fontSize": 16,
  // ...
}

It looks as if the font is actually used, but all syntax highlighting gets lost and the text gets just rendered in black.

Screenshot 2020-05-27 at 23 42 23

I'm using MacOS 10.15.4.

@mabuchner
Copy link
Author

mabuchner commented May 27, 2020

As a workaround I'm using a patched version of this font ("SauceCodePro Nerd Font"), which incorporates more icons:

https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.1.0

This font seems to work fine.

Screenshot 2020-05-27 at 23 42 13

@mabuchner
Copy link
Author

Here is the log output of oni2 -f --trace --log-filter Window,Font when using "Source Code Pro" as editor font and "SauceCodePro Nerd Font" as terminal font:

[DEBUG]   +25ms Oni2.Exception : Recording backtraces
[DEBUG]  +124ms Revery.Core.Window : Starting window creation...
[INFO]     +0ms Revery.Core.Window : Creating window Oni2 width: 1440 height: 780
[INFO]    +29ms Revery.Core.Window : Window created successfully.
[DEBUG]    +0ms Revery.Core.Window : - Id: 1
[DEBUG]    +0ms Revery.Core.Window : - PixelFormat: SDL_PIXELFORMAT_ARGB8888
[DEBUG]    +0ms Revery.Core.Window : Setting window context
[DEBUG]   +22ms Revery.Core.Window : GL setup. Checking GL version...
[DEBUG]    +0ms Revery.Core.Window : Checking GL vendor...
[DEBUG]    +0ms Revery.Core.Window : Checking GL shading language version...
[INFO]     +0ms Revery.Core.Window : OpenGL hardware info:
[INFO]     +0ms Revery.Core.Window :   renderer: Intel HD Graphics 4000 OpenGL Engine
[INFO]     +0ms Revery.Core.Window :   version: 4.1 INTEL-14.5.22
[INFO]     +0ms Revery.Core.Window :   vendor: Intel Inc.
[INFO]     +0ms Revery.Core.Window :   shadingLanguageVersion: 4.10
[DEBUG]    +0ms Revery.Core.Window : Loading icon from: /Applications/Onivim2.app/Contents/Resources/../MacOS/logo.png
[DEBUG]    +4ms Revery.Core.Window : Icon loaded successfully.
[DEBUG]    +5ms Revery.Core.Window : Icon set successfully.
[DEBUG]    +0ms Revery.Core.Window : Getting window metrics
[DEBUG]    +0ms Revery.Core.Window : Metrics: { scaledSize = { width = 1440; height = 780 };
  unscaledSize = { width = 1440; height = 780 };
  framebufferSize = { width = 1440; height = 780 }; devicePixelRatio = 1.;
  scaleFactor = 1.; zoom = 1.; isDirty = false }
[TRACE]    +0ms Revery.Core.Window : setSize - calling with: 1440x780
[TRACE]    +0ms Revery.Core.Window : setRawSize - calling with: 1440x780
[INFO]     +0ms Revery.Core.Window : Using vsync: Immediate
[TRACE]    +3ms Revery.Core.Window : updateMetrics - new metrics: { scaledSize = { width = 1440; height = 780 };
  unscaledSize = { width = 1440; height = 780 };
  framebufferSize = { width = 1440; height = 780 }; devicePixelRatio = 1.;
  scaleFactor = 1.; zoom = 1.; isDirty = false }
[INFO]    +55ms Oni2.Service.Font : Loading font: FiraCode-Regular.ttf 14.000000 1
[INFO]     +0ms Oni2.Service.Font : Loading font: FiraCode-Regular.ttf 12.000000 1
[TRACE]    +6ms Oni2.Service.FontLoader : loadAndValidateEditorFont path: /Applications/Onivim2.app/Contents/Resources/../MacOS/FiraCode-Regular.ttf | size: 14.000000
[TRACE]   +99ms Oni2.Service.FontLoader : loadAndValidateEditorFont path: /Applications/Onivim2.app/Contents/Resources/../MacOS/FiraCode-Regular.ttf | size: 12.000000
[INFO]     +4ms Revery.FontCache : Loaded : /Applications/Onivim2.app/Contents/Resources/../MacOS/FiraCode-Regular.ttf
[DEBUG]    +5ms Oni2.Service.FontLoader : Measured width: 7.200000
[DEBUG]    +0ms Oni2.Service.FontLoader : Line height: 14.399963
[INFO]     +0ms Revery.FontCache : Loaded : /Applications/Onivim2.app/Contents/Resources/../MacOS/FiraCode-Regular.ttf
[DEBUG]    +1ms Oni2.Service.FontLoader : Measured width: 8.400000
[DEBUG]    +0ms Oni2.Service.FontLoader : Line height: 16.799957
[INFO]     +9ms Oni2.Service.Font : Loading font: Source Code Pro 16.000000 2
[INFO]     +0ms Oni2.Service.Font : Loading font: SauceCodePro Nerd Font 16.000000 2
[DEBUG]    +1ms Oni2.Service.Font : Discovering font: SauceCodePro Nerd Font
[DEBUG]    +0ms Oni2.Service.Font : Discovering font: Source Code Pro
[DEBUG]   +16ms Oni2.Service.Font :   at path: /Users/Martin/Library/Fonts/Sauce Code Pro Nerd Font Complete.ttf
[TRACE]    +0ms Oni2.Service.FontLoader : loadAndValidateEditorFont path: /Users/Martin/Library/Fonts/Sauce Code Pro Nerd Font Complete.ttf | size: 16.000000
[INFO]     +3ms Revery.FontCache : Loaded : /Users/Martin/Library/Fonts/Sauce Code Pro Nerd Font Complete.ttf
[DEBUG]    +1ms Oni2.Service.FontLoader : Measured width: 9.600000
[DEBUG]    +0ms Oni2.Service.FontLoader : Line height: 20.111816
[DEBUG]    +1ms Oni2.Service.Font :   at path: /Users/Martin/Library/Fonts/SourceCodePro-Regular.ttf
[TRACE]    +0ms Oni2.Service.FontLoader : loadAndValidateEditorFont path: /Users/Martin/Library/Fonts/SourceCodePro-Regular.ttf | size: 16.000000
[INFO]     +2ms Revery.FontCache : Loaded : /Users/Martin/Library/Fonts/SourceCodePro-Regular.ttf
[DEBUG]    +1ms Oni2.Service.FontLoader : Measured width: 9.600000
[DEBUG]    +0ms Oni2.Service.FontLoader : Line height: 20.111816
[TRACE]  +161ms Revery.Core.Window : updateMetrics - new metrics: { scaledSize = { width = 1440; height = 780 };
  unscaledSize = { width = 1440; height = 780 };
  framebufferSize = { width = 1440; height = 780 }; devicePixelRatio = 1.;
  scaleFactor = 1.; zoom = 1.; isDirty = false }
[INFO]     +9ms Revery.FontCache : Loaded : Inter-UI-Medium.ttf
[INFO]     +2ms Revery.FontCache : Loaded : FontAwesome5FreeRegular.otf
[INFO]     +3ms Revery.FontCache : Loaded : FontAwesome5FreeSolid.otf
[INFO]     +3ms Revery.FontCache : Loaded : Inter-UI-Regular.ttf
[INFO]    +10ms Revery.FontCache : Loaded : seti.ttf
[INFO]    +63ms Revery.FontCache : Loaded : Inter-UI-Italic.ttf

@glennsl glennsl added A-font Area: Font loading and rendering bug Something isn't working labels May 27, 2020
@mabuchner
Copy link
Author

I have now idea, which change actual solved this, but this doesn't seem to be a problem anymore. The "Source Code Pro" font now works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-font Area: Font loading and rendering bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants