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

pango: temp fix for font size on Retina displays #27392

Closed
wants to merge 1 commit into from

Conversation

hamishmack
Copy link
Contributor

John Ralls jralls@ceridwen.us writes:

Cairo's CGFont backend already handles scaling fonts to the display
resolution, so scaling to the screen screen resolution in Pango's
CoreText backend generates double-sized text on a Retina display.

The layout test depended on providing a (bogus) resolution of 96DPI and
scaling the font to it in order to obtain the "expected" layout results.
This is replaced by adjusting the font size in test-layout.c if Pango is
compiled for CoreText.

https://bugzilla.gnome.org/show_bug.cgi?id=782393

Motivation for this change
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

John Ralls <jralls@ceridwen.us> writes:

Cairo's CGFont backend already handles scaling fonts to the display
resolution, so scaling to the screen screen resolution in Pango's
CoreText backend generates double-sized text on a Retina display.

The layout test depended on providing a (bogus) resolution of 96DPI and
scaling the font to it in order to obtain the "expected" layout results.
This is replaced by adjusting the font size in test-layout.c if Pango is
compiled for CoreText.

https://bugzilla.gnome.org/show_bug.cgi?id=782393
@mention-bot
Copy link

@hamishmack, thanks for your PR! By analyzing the history of the files in this pull request, we identified @vcunat, @urkud and @johbo to be potential reviewers.

@hamishmack
Copy link
Contributor Author

My nixpkgs might just have had an old version of something (perhaps pango), now I have rebased this change on the latest nixpkgs it does not seem to be needed.

@hamishmack hamishmack closed this Jul 15, 2017
@vbgl
Copy link
Contributor

vbgl commented Jul 17, 2017

It seems that this patch does have some positive effect on current master. E.g., in gnumeric, without this patch, the fonts are clearly rendered too big. They look correctly sized with this patch.

@hamishmack
Copy link
Contributor Author

@vbgl I think I messed up my testing. You are right, this patch does make things better for me too.

It does make some fonts smaller than they should be (in Leksah at least). The ones it makes smaller though (at least in Leksah) have easy configuration options to make them bigger again.

@hamishmack hamishmack reopened this Jul 17, 2017
@vbgl
Copy link
Contributor

vbgl commented Jul 18, 2017

Can you download the patch using e.g., fetchpatch instead of copying it into nixpkgs? Thanks.

BTW, pango-1.40.7 is out, but it does not seem to address this issue.

@vcunat
Copy link
Member

vcunat commented Jul 18, 2017

The bug is marked as NEW, so apparently upstream hasn't accepted that solution (yet). (I'd leave the decision to darwin-using members.)

@Mic92 Mic92 added the 6.topic: darwin Running or building packages on Darwin label Jul 18, 2017
@fpletz
Copy link
Member

fpletz commented Aug 31, 2017

Upstream has applied the patch. Would you please use fetchpatch instead of adding the patch to the repo?

@hamishmack
Copy link
Contributor Author

Upstream has applied the patch. Would you please use fetchpatch instead of adding the patch to the repo?

Sorry I did not get around to this. It might be better just to upgrade pango to 1.40.11 now. I have tried that out here and it seems to work.

@hamishmack hamishmack closed this Aug 31, 2017
@vcunat
Copy link
Member

vcunat commented Sep 3, 2017

That pango update is now in staging: daa12ab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants