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

Bold font renderings appear odd depending on weight #818

Open
racagogi opened this issue Nov 25, 2024 · 6 comments
Open

Bold font renderings appear odd depending on weight #818

racagogi opened this issue Nov 25, 2024 · 6 comments

Comments

@racagogi
Copy link

version:26e7c60
os: wayland arch linux, windows 11
problem: Bold font not redering under weight 700
config:

[fonts]
size = 18
features = []
family="Jetbrains Mono"
extras = [{ family = "KoPubWorldDotum_Pro" }, {family= "Noto Color Emoji"}]

[fonts.emoji]
family = "Noto Color Emoji"

[fonts.regular]
family="JetBrainsMono"
weight = 400

[fonts.bold]
family="Jetbrains Mono"
weight = 700

[fonts.italic]
family="Jetbrains Mono"
style = "Italic"
weight = 400

[fonts.bold-italic]
family="Jetbrains Mono"
style = "Italic"
weight = 700

[fonts.ui]
family="Jetbrains Mono"
weight = 700

2024-11-25 22-52-34

[fonts.bold]
family="Jetbrains Mono"
weight = 699

[fonts.bold-italic]
family="Jetbrains Mono"
style = "Italic"
weight = 699

2024-11-25 22-52-57

[fonts.bold]
family="Jetbrains Mono"
weight = 699

2024-11-25 22-53-26

logfile:

2024-11-25T14:02:11.928190Z  INFO /home/raca/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sugarloaf-0.2.2/src/font/mod.rs:602: Font search: 'Query { families: [Name("Jetbrains Mono")], weight: Weight(699), stretch: Normal, style: Normal }'
2024-11-25T14:02:11.929246Z  INFO /home/raca/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sugarloaf-0.2.2/src/font/mod.rs:620: Font 'Jetbrains Mono' found in /usr/share/fonts/otf/JetBrainsMono-Bold.otf
2024-11-25T14:02:11.929250Z  INFO /home/raca/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sugarloaf-0.2.2/src/font/mod.rs:602: Font search: 'Query { families: [Name("Jetbrains Mono")], weight: Weight(699), stretch: Normal, style: Italic }'
2024-11-25T14:02:11.930286Z  INFO /home/raca/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sugarloaf-0.2.2/src/font/mod.rs:620: Font 'Jetbrains Mono' found in /usr/share/fonts/otf/JetBrainsMono-BoldItalic.otf
2024-11-25T14:02:11.933223Z  INFO /home/raca/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sugarloaf-0.2.2/src/font/mod.rs:602: Font search: 'Query { families: [Name("Jetbrains Mono")], weight: Weight(700), stretch: Normal, style: Normal }'
2024-11-25T14:02:11.934027Z  INFO /home/raca/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sugarloaf-0.2.2/src/font/mod.rs:620: Font 'Jetbrains Mono' found in /usr/share/fonts/otf/JetBrainsMono-Bold.otf

expected result:

wezterm config
function module.set(config)
	config.font_size       = 14
	config.unicode_version = 14
	config.font            = wezterm.font_with_fallback {
		{
			family = 'JetBrains Mono',
			weight = 'Regular',
			style = "Normal"
		},
		"KoPubWorld돋움체_Pro Medium",
		"Noto Color Emoji"
	}
	config.font_rules      = {
		{
			intensity = 'Bold',
			italic = true,
			font = wezterm.font_with_fallback {
				{
					family = 'JetBrains Mono',
					weight = 'Bold',
					style = "Italic"
				},
				"KoPubWorld바탕체_Pro Bold",
				"Noto Color Emoji"
			},
		},
		{
			intensity = 'Bold',
			italic = false,
			font = wezterm.font_with_fallback {
				{
					family = 'JetBrains Mono',
					weight = 'Bold',
					style = "Normal"
				},
				"KoPubWorld돋움체_Pro Bold",
				"Noto Color Emoji"
			}
		},
		{
			italic = true,
			font = wezterm.font_with_fallback {
				{
					family = 'JetBrains Mono',
					weight = 'Regular',
					style = "Italic"
				},
				"KoPubWorld바탕체_Pro Medium",
				"Noto Color Emoji"
			}
		}
	}
end

2024-11-25 23-16-11

@racagogi
Copy link
Author

this issue occurs when using otf font

@raphamorim
Copy link
Owner

this issue occurs when using otf font

does it goes away with ttf?

@raphamorim
Copy link
Owner

raphamorim commented Dec 5, 2024

btw you need to remove family="Jetbrains Mono" from the config otherwise rio will not load your custom config per style

[fonts]
size = 18
features = []
extras = [{ family = "KoPubWorldDotum_Pro" }, {family= "Noto Color Emoji"}]

[fonts.emoji]
family = "Noto Color Emoji"

[fonts.regular]
family="JetBrainsMono"
weight = 400

[fonts.bold]
family="Jetbrains Mono"
weight = 700

[fonts.italic]
family="Jetbrains Mono"
style = "Italic"
weight = 400

[fonts.bold-italic]
family="Jetbrains Mono"
style = "Italic"
weight = 700

[fonts.ui]
family="Jetbrains Mono"
weight = 700

@racagogi
Copy link
Author

racagogi commented Dec 5, 2024

I tried this configuration but stil not work.
This problem occures when using nerd font v3.3.0 facthed Jetbrains Mono v3.2.0 patched otf fonts works nicely.

@racagogi
Copy link
Author

racagogi commented Dec 5, 2024

fc-scan JetBrainsMono-Bold.otf | grep weight result
nerd font 3.2.1 weight: 200(f)(s)
nerd font 3.3.0 weight: 146.4(f)(s)

@racagogi
Copy link
Author

racagogi commented Dec 5, 2024

this commit change fonts weight
previous commit JetBrains Mono + v3.3.0 nerd font works weight 600.
but below 600, used Bold-Italic instead Bold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants