-
-
Notifications
You must be signed in to change notification settings - Fork 900
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
Fonts being displayed incorrectly #1298
Comments
Maybe because the font was not loaded at the first time. It's required to call
|
Sorry for my late reply, I checked this line on my machine and its there so... I don't understand what you are trying to say, I named the custom font that I added to the source code "MyFont" should I add it to the end of this line or what? |
Hi folks, I stumbled across the same bug. I use an inlined nerd font (as described in the wiki) and pass the following arguments to ttyd It looks like the fit() / resize() functions compare the rows and cols and behave different when values are the same as before or different. Also somehow the CharSizeService of xterm.js is taken into account. I can't dig deeper into it but for the moment I fixed it this way: ttyd/html/src/components/terminal/xterm/index.ts default:
console.log(`[ttyd] option: ${key}=${JSON.stringify(value)}`);
if (terminal.options[key] instanceof Object) {
terminal.options[key] = Object.assign({}, terminal.options[key], value);
} else {
terminal.options[key] = value;
}
if (key.indexOf('font') === 0) {
+ setTimeout(() => {
+ terminal.resize(Math.max(0, terminal.cols - 1), terminal.rows);
+ }, 100);
fitAddon.fit();
}
break; Then the usual yarn build and make. A very dirty hack but at least it works... |
This has been driving me crazy. After:
Add: this.terminal.options.fontFamily = 'My Font'; |
When I launch ttyd from the browser in a new tab the fonts gets displayed incorrectly the first time, in order to fix it, you would have to refresh the page every time you launch it in a new tab.
I complied ttyd from source and I added the Caskaydia Cove Nerd Font using the instructions described in the Wiki, and then started the ttyd binary using the following parameters:
'-p 6175 -W -t fontSize=15 -t enableSixel=true -t enableZmodem=true -t "fontFamily=My Font" login'
Screenshots:
Environment:
log of ttyd:
log.txt
The text was updated successfully, but these errors were encountered: