-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
disable pango #628
disable pango #628
Conversation
haven't looked in detail, but something needs to happen because 7522aca was a breaking change that crept in on a minor and by the issues filed here it's clear that it's causing a lot of pain |
Also, on my computer (OS X 10.11, was also present in 10.10) trying to render text to the canvas, when built with pango, breaks every further draw call without giving any errors. If I start by rendering text, I get a blank canvas, otherwise I get whatever I drew up 'til the first text call. I'm very much +1 on merging this until we can get it working stable across the board. |
Very much against this. We use pango for font fallbacks and not having it would be a show stopper for us. Is it just on osx where people are having problems with this? My usage is Linux (Ubuntu) only. |
Isn't this caused by the issue shown in #525 ? Or is it something completely different? |
my problem is Linux, at this stage I have no clue how to make custom fonts work for nodei.co without this patch applied, Pango has entirely screwed up the config, this should have been done in a minor version bump if at all |
@jakeg What do you mean with font fallbacks? I'm not entirely sure myself on what pango does for us so it would be nice with some insight :) |
@LinusU firstly, big thank you for all your work the last few weeks, the project was looking rather abandoned before you turned up! Try using a glyph that isn't within the currently set font. Pango enables you to set multiple fonts to use as fallbacks for those glyphs, but without pango the glyph doesn't get rendered at all! Try eg Chinese, Korean or Arabic letters. |
Thank you, it's always nice to know that your work is appreciated :) This helps me understand the issue as well, I'm gonna try and dig deeper into the issues I'm having and see if there is a way to properly solve it. |
+1 for this being applied. Using Ubuntu, it doesn't crash, it just doesn't load custom fonts. From what it looks like, the Pango rendering requires the font to be installed on the system, which is not possible for my uses. |
Guys, any update on this? 😕 |
@LinusU or @jakeg Is this fixed? I have node installed on a Ubuntu server and I'm having issues with using custom fonts. What I'm experiencing is that the custom font which is located in the same files hierarchy is completely ignored, and the default font is used. Also the font size is also ignored. Any idea how can i fix it on the Ubuntu server? UPDATE: Changing manually the binding.gyp to disable pango didn't work. |
What solved the problem was commenting out: |
Did you recompile ( |
Nope :-) probably should have. But like I said just commenting out: |
Then it's probably loading the font from the system fonts instead of from your file. |
+1 Or get Pango working somehow. Seems like a lot of issues can be closed by getting Pango to work or removing it. Also:
|
Ok, going through my project files looking for all relevant stuff for this as I can see this is really coming to a head for some people now... As far as I can see, you can use Pango without system-installed fonts, but fallback fonts do need to be system installed (and I think you need to have/use fontconfig for them too?) if you want them to work. You don't get fallback fonts without pango, so no loss there if you can't do system installed fonts. What are fallback fonts? So if you're using a font and a glyph doesn't exist in that font, you want that glyph displayed in a different font - the fallback font - instead (otherwise it will just be e.g. an empty rectanglle). I run this command to install a ton of fallback fonts on my Ubuntu server:
So as well as system-installing those fallback fonts, I go and grab all the Google web fonts too with this handy little script I made: Note that for sanity, I use FVD naming (see https://github.com/typekit/fvd) for fonts and my script above handles that perfectly, renaming all the Google web fonts with sane FVD naming instead. With those fonts all installed, I then use something like this to actually use the fonts. Remember, as we're using pango, we can't do
Note that if you installed all the fallback fonts, no matter what font you are currently set to in ctx the following should output fine as all the missing glyphs in that font will find one to fallback on:
|
If it wasn't clear from my post above, only the fallback fonts need to be installed system-wide, not your regular usage fonts. All the other fonts can go wherever you want (though may require fontconfig being used/installed?) and get added with |
The fallback font stuff comes from FontConfig, though, no? The way the code is now you would get the font substitution like you said which is great. I understand that with Pango support you just use |
OH I think this is an OS X issue. Pango doesn't use FontConfig on OS X! It needs to use CoreText somehow in this case... that'd explain why the people who have no problem with it are always using Ubuntu... |
@chearon pango can't use fontconfig or you mean because fontconfig isn't installed on OSX? http://apple.stackexchange.com/questions/118737/does-osx-10-9-1-have-fontconfig-installed-by-default |
@jakeg I suspected that OS X Pango was using something other than FontConfig to look up fonts. Now I'm not sure about that, but the problem lies somewhere with FontConfig + Pango. I tried making a standalone C program that loaded a font from a file and added it to FontConfig exactly the way the creator of Pango recommends, and it did not render on Mac OS :( |
@jakeg Please never use @chearon Appreciate you looking into this! I should add that loading fonts from ttf-files doesn't work for me on Ubuntu 14.04 when built with pango. When building without it works. I have the same problem on OS X as well, so I don't think it's only an OS X issue... |
@LinusU you didn't call edit: referring to your Ubuntu test case edit2: also, for |
Since v2.0 made Pango required, can this be closed? |
Yup! I'm going to go through now and close all the issues I listed forever ago in #715 |
I can't get custom fonts (in custom locations) working when pango is enabled and there's no easy way to turn it off other than editing binding.gyp. This commit basically reverts 7522aca
See also discussion @ #570
Unless custom font loading can be fixed with Pango or good documentation provided then I'd like to see it disabled.
Likely related are #624 and #618