Cairo font configuration

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cairo font configuration

Ivan Vučica-2


On Sun, Nov 26, 2017, 09:50 Riccardo Mottola <[hidden email]> wrote:

There are some facts I don't like and want to change:
* NEXTSPACE is based on quite outdated release of GNUstep (base 1.24.8, gui and back 0.24.1);
* It is based on ART backend. I want to use Cairo backend but ART has usefull features (.nfont packages provide ability to set hinting and antialiasing options on per font basis).


I understand that! ART continues to be intriguing and it still works after many years, it is fast, fotns look better and the possibility of using non-antialiased fonts is just great. They look far better in Terminal, Code-Editors and for my test also Menus.

Doesn't Cairo use fontconfig?

Or does something in the way GNUstep-back uses it make it ignore the fontconfig configuration?

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: Cairo font configuration

Fred Kiefer
Hi Ivan,

I think we are all on this list for this reason I reduced the recipients list.

Of course cairo uses fontconfig when available. The problem Sergei and Riccardo are talking about really exists and it is caused by a known bug in the cairo handing of fixed fonts. That is the reason why terminal gets mentioned. There fixed fonts are still popular.
The issue is cairo is reusing and scaling a fixed font even if there is a proper version available for the required size. The only workaround I see, beside fixing inside of cairo, is to not reuse fixed fonts. But this is to costly, rather we would need our own cache for these fonts, duplicating the cairo code.
I could send you references of the relevant cairo and GNUstep code as soon as I am back home.

Fred

On the road

Am 26.11.2017 um 12:26 schrieb Ivan Vučica <[hidden email]>:



On Sun, Nov 26, 2017, 09:50 Riccardo Mottola <[hidden email]> wrote:

There are some facts I don't like and want to change:
* NEXTSPACE is based on quite outdated release of GNUstep (base 1.24.8, gui and back 0.24.1);
* It is based on ART backend. I want to use Cairo backend but ART has usefull features (.nfont packages provide ability to set hinting and antialiasing options on per font basis).


I understand that! ART continues to be intriguing and it still works after many years, it is fast, fotns look better and the possibility of using non-antialiased fonts is just great. They look far better in Terminal, Code-Editors and for my test also Menus.

Doesn't Cairo use fontconfig?

Or does something in the way GNUstep-back uses it make it ignore the fontconfig configuration?

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: Cairo font configuration

David Chisnall
On 26 Nov 2017, at 11:48, Fred Kiefer <[hidden email]> wrote:
>
> Of course cairo uses fontconfig when available. The problem Sergei and Riccardo are talking about really exists and it is caused by a known bug in the cairo handing of fixed fonts. That is the reason why terminal gets mentioned. There fixed fonts are still popular.
> The issue is cairo is reusing and scaling a fixed font even if there is a proper version available for the required size. The only workaround I see, beside fixing inside of cairo, is to not reuse fixed fonts. But this is to costly, rather we would need our own cache for these fonts, duplicating the cairo code.
> I could send you references of the relevant cairo and GNUstep code as soon as I am back home.

As I recall from looking at the Cairo back end code, a big part of the problem is that we are using the wrong API.  Cairo exposes two APIs for dealing with fonts.  The ‘toy’ API, which is intended for simple demos and things that only need a small amount of text rendering, and the more complex API that exposes all of the details of fonts and is intended to be used in conjunction with Harfbuzz or similar.  We use the toy API.  The real fix is to move to the complete API and integrate Harfbuzz, but this is a nontrivial amount of work.

In semi-related news, I was recently looking at Sile to see if it would be possible to use as an NSTypesetter implementation.  Sile is written in Lua and provides the same basic model as the OpenStep text system (boxes, runs, and so on) and implements all of the algorithms from the TeX papers.  It ought to be fairly easy to wire it up to the text system and get LaTeX-quality text rendering, but unfortunately it’s somewhat lacking in documentation.

David


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: Cairo font configuration

Sergii Stoian
In reply to this post by Fred Kiefer
Hi Fred,

On Sun, Nov 26, 2017 at 1:48 PM, Fred Kiefer <[hidden email]> wrote:
Hi Ivan,

I think we are all on this list for this reason I reduced the recipients list.

Of course cairo uses fontconfig when available. The problem Sergei and Riccardo are talking about really exists and it is caused by a known bug in the cairo handing of fixed fonts. That is the reason why terminal gets mentioned. There fixed fonts are still popular.
The issue is cairo is reusing and scaling a fixed font even if there is a proper version available for the required size. The only workaround I see, beside fixing inside of cairo, is to not reuse fixed fonts. But this is to costly, rather we would need our own cache for these fonts, duplicating the cairo code.
I could send you references of the relevant cairo and GNUstep code as soon as I am back home.

Writing about .nfont packages used in ART backend I meant not only this. For example, RobotoMono font looks quite weird without antialiasing (hinting?), LiberationMono looks good. With .nfont package for RobotoMono I've added "RenderHints_hack = 0x010203;" and after user copy this package into it's ~/Library/Fonts directory everything works as font package creator think should be better for user. Liberation Mono has no "RenderHints_hack" at all. Everybody is happy.
If I want RobotoMono to be drawn antialiased at any size and other fonts non-antialiased at size less then 12 I need to add configuration (system or user) on font install.
Sure both ways has right to live but fontconfig way breaks NeXT/Apple style of doing things that GNUstep follows to.
Did I miss something?
Fred

On the road

Am 26.11.2017 um 12:26 schrieb Ivan Vučica <[hidden email]>:



On Sun, Nov 26, 2017, 09:50 Riccardo Mottola <[hidden email]> wrote:

There are some facts I don't like and want to change:
* NEXTSPACE is based on quite outdated release of GNUstep (base 1.24.8, gui and back 0.24.1);
* It is based on ART backend. I want to use Cairo backend but ART has usefull features (.nfont packages provide ability to set hinting and antialiasing options on per font basis).


I understand that! ART continues to be intriguing and it still works after many years, it is fast, fotns look better and the possibility of using non-antialiased fonts is just great. They look far better in Terminal, Code-Editors and for my test also Menus.

Doesn't Cairo use fontconfig?

Or does something in the way GNUstep-back uses it make it ignore the fontconfig configuration?

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev




--
Sergii Stoian, ProjectCenter maintainer

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev