microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.22k stars 8.16k forks source link

Some installed fonts are not loading #295

Open EgMan opened 5 years ago

EgMan commented 5 years ago

Windows build: Microsoft Windows [Version 10.0.16299.665]

What I'm trying to do: Install a font to windows and load it into the default terminal emulator for WSL ubuntu.

What's wrong: Not all installed fonts are available. As one example, I have installed GNU unifont as shown here: image

But I am unable to locate this font in the settings pane of the default terminal. image image

On the other hand, other terminal emulators have no problem locating all of my fonts. Here's the font selected ConEmu's settings pane: image

This is not the only font I've had issues with. For some reason, fonts like Ubuntu Mono show up just fine. But fonts like GNU Unifont or Everson Mono will not show up. Is there some hidden feature of these fonts which makes them incompatible for WSL ubuntu's default terminal? Or is this perhaps a defect? Any help with getting these fonts added would be greatly appreciated. Thank you.

As a side note: I'd also appreciate if anyone could educate me on what is the proper name for "WSL ubuntu's default terminal."

zadjii-msft commented 5 years ago

As a side note: I'd also appreciate if anyone could educate me on what is the proper name for "WSL ubuntu's default terminal."

The default "terminal" on Windows is conhost.exe. It's the same application that hosts all commandline applications on Windows - cmd.exe, powershell, wsl, all run attached to conhost.exe.

I believe most monospaced fonts should work in conhost, but I can't recall the specific metrics by which we decide if a particular font is usable or not. Perhaps @miniksa might know more?

alabuzhev commented 5 years ago

the specific metrics by which we decide if a particular font is usable or not

The Old New Thing - Why are console windows limited to Lucida Console and raster fonts?

zadjii-msft commented 5 years ago

I don't think that's strictly true anymore. We (@paulcam206) added support for more freely setting the fonts, we fixed the bugs Raymond describes there.

miniksa commented 5 years ago

It looks like we're asking GDI for FIXED_PITCH, FF_MODERN, and TrueType fonts that match the charset associated with whatever codepage you have the console set to. See LOGFONT documentation and TranslateCharsetInfo documentation.

If it doesn't show up, then you either have the wrong codepage or GDI thinks that the font doesn't have one of the properties above.

Also the limitations described by Raymond don't all apply anymore. We took a bunch of them out by either fixing bugs or inserting workarounds like clipping glyphs to rectangles.

Jaykul commented 5 years ago

You can actually set pretty much any TrueType font (via the SetCurrentConsoleFontEx API) if you don't care about how weird it looks ...

I have C# code for the LOGFONT stuff in my font module if that helps...

E3V3A commented 5 years ago

I just filed this and this issues, but was referred back to you console guys here.

  1. Somehow color escape codes are not being passed down to mintty from ColorTool.exe
  2. For some reason the monospace fonts are not getting found in the (PS) console settings.
  3. For some reason the 2 default (?) fonts (Lucida Console and Consolas) has so terrible unicode support, it doesn't even provide for the basic ASCII graphics unicodes, like these and here.
zadjii-msft commented 5 years ago

@E3V3A Could you file new issues for each of these? Best practice is to not overload existing threads with new (unrelated) topics.

mailinglists35 commented 5 years ago

I have copied apples' SF Mono from a macos box but it is not shown in the font choosing ui. What can a humble end user do to have this font available? The blog linked above points to a kb article http://support.microsoft.com/kb/247815 but it is no longer available

miniksa commented 5 years ago

@mailinglists35, My October 26th post is what the code is looking for when it is choosing a font. Otherwise, I have no idea why your font isn't appearing. I couldn't tell unless I debugged it.

I'm also relatively certain that your usage of copying and pasting it from a MacOS box to a Windows machine is against Apple's licensing agreement for that font. As such, I cannot help you any further.

mailinglists35 commented 5 years ago

against Apple's licensing agreement

Using a free developer account I have downloaded Xcode 8 which contains the font. Using WSL I was able to unpack the downloaded file and extract the font.

Nowehere in the license file I find text restricting personal usage of that font. There are paragraphs about the software and sdk, but literally nothing about the font.

miniksa commented 5 years ago

Fonts, especially fonts that major corporations commission as their flagship design system, are generally copyrighted and licensed.

An express lack of written permission means that I must choose the safe option and believe that I do not have permission.

Therefore, I cannot gain access to this font and debug the issue which follows then that I cannot help you. I'm sorry.

E3V3A commented 5 years ago

@mailinglists35 Why don't you choose another font? :see_no_evil: (and perhaps you get some help with the issue. at hand.)

Jaykul commented 5 years ago

For what it's worth, the SF Font is San Fransisco, the system font for iOS, macOS, tvOS, and watchOS. which is freely downloadable, but is only for use creating mock-ups of UI for iOS, macOS, tvOS, and watchOS -- you can see the license in the source of that page, or in the license file in the zip.

mailinglists35 commented 5 years ago

Also Roboto Mono is not displayed. Latest update TTF files here

MFry commented 4 years ago

This is still an issue.

zadjii-msft commented 4 years ago

@MFry typically you can tell that something is still an issue if the issue is still open 😉

AnrDaemon commented 4 years ago

The "Hellfont Cyr" terminal font is not rendered in v2 console. Instead of its 9x16 typeface, some random 12x16 is chosen.

(Left is ForceV2=0, right is ForceV2=1. Same font settings.)

image

DHowett-MSFT commented 4 years ago

@AnrDaemon Sorry, the v2 console doesn't support bitmap fonts.

AnrDaemon commented 4 years ago

Then why it allows selecting them, pretty please?

DHowett-MSFT commented 4 years ago

@AnrDaemon because the last time anybody made sweeping changes to the property page infrastructure in the console I was an infant. :smile:

AnrDaemon commented 4 years ago

I'm not saying about sweeping changes. I'm saying about disconnection between apparent configuration and actual behavior. Also, there's no true type font that does not induce eye bleeding after hours of watching it in console. Iosevka Slab is close, but not all shapes are blending well. (And no, Fira Code is worse than Lucida Console, as it is same sans serif but condensed.)

zadjii-msft commented 4 years ago

Also, there's no true type font that does not induce eye bleeding after hours of watching it in console.

I mean, speaking as a developer who uses TrueType fonts for hours in the Terminal and doesn't experience eye bleeding, you might want to talk to a doctor about that. 😝

The real answer here is simply that the Vintage Console property sheet simply isn't receiving updates anymore. So at some point, we stopped supporting bitmap fonts in the console, but forgot to remove the code from the property sheet to load those fonts as well. It could be reasoned that this is a bug in behavior for the property sheet. I'll move that to it's own thread.