Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

Supplied fontconfig causes serif font to be used in Evolution Preview Pane #35

Closed
TamasBarta opened this issue May 8, 2016 · 11 comments

Comments

@TamasBarta
Copy link

When I install emojione-color-font from AUR (using Antergos here), and my font is set to Cantarell, a serif font appears in my e-mails in Evolution. I couldn't determine any issue being closely related to this, so I opened this ticket.
I'm not even sure what additional information is required. Please let me know, and I'll update.

@13rac1
Copy link
Owner

13rac1 commented May 8, 2016

Please run the tests https://github.com/eosrei/emojione-color-font/tree/master/linux/tests It'll confirm whether your fontconfig is setup correctly. You'll need both files.

@TamasBarta
Copy link
Author

Results:

diff current-results.test expected-results.test
Font: sans                                                         Font: sans
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: sans-serif                                                   Font: sans-serif
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: serif                                                        Font: serif
VeraSe.ttf: "DejaVu Serif" "Roman"                              |  VeraSe.ttf: "Bitstream Vera Serif" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: mono                                                         Font: mono
VeraMono.ttf: "DejaVu Sans Mono" "Roman"                        |  VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: monospace                                                    Font: monospace
VeraMono.ttf: "DejaVu Sans Mono" "Roman"                        |  VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Bitstream Vera Sans                                          Font: Bitstream Vera Sans
DejaVuSans.ttf: "DejaVu Sans" "Book"                            |  Vera.ttf: "Bitstream Vera Sans" "Roman"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"                       |  EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Bitstream Vera Serif                                         Font: Bitstream Vera Serif
DejaVuSerif.ttf: "DejaVu Serif" "Book"                          |  VeraSe.ttf: "Bitstream Vera Serif" "Roman"
DejaVuSerif-Bold.ttf: "DejaVu Serif" "Bold"                     |  EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: Bitstream Vera Sans Mono                                     Font: Bitstream Vera Sans Mono
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"                   |  VeraMono.ttf: "Bitstream Vera Sans Mono" "Roman"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"              |  EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"

Font: emoji                                                        Font: emoji
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

Font: Emoji One Color                                              Font: Emoji One Color
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

Font: Apple Color Emoji                                            Font: Apple Color Emoji
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

Font: Segoe UI Emoji                                               Font: Segoe UI Emoji
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

Font: Noto Color Emoji                                             Font: Noto Color Emoji
EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"             EmojiOneColor-SVGinOT.ttf: "Emoji One Color" "Regular"
Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

Fontconfig tests: FAIL

I investigated a little more. Your fontconfig is stored as /etc/fonts/conf.avail/56-emojione-color-font.conf.

I also have 57-dejavu-sans.conf there:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<!-- /etc/fonts/conf.d/57-dejavu-sans.conf

     Define aliasing and other fontconfig settings for
     DejaVu Sans.

     © 2006-2008 Nicolas Mailhot <nicolas.mailhot at laposte.net>
-->
<fontconfig>
  <!-- Font substitution rules -->
  <alias binding="same">
    <family>Arev Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>Bepa</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>Bitstream Prima Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>Bitstream Vera Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>DejaVu LGC Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>Hunky Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>Olwen Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>SUSE Sans</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <alias binding="same">
    <family>Verajja</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <!-- In case VerajjaPDA stops declaring itself as Verajja -->
  <alias binding="same">
    <family>VerajjaPDA</family>
    <accept>
      <family>DejaVu Sans</family>
    </accept>
  </alias>
  <!-- Generic name assignment -->
  <alias>
    <family>DejaVu Sans</family>
    <default>
      <family>sans-serif</family>
    </default>
  </alias>
  <!-- Generic name aliasing -->
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>DejaVu Sans</family>
    </prefer>
  </alias>
</fontconfig>

I'm groping in the dark, but I hope I managed to provide something useful.

@13rac1
Copy link
Owner

13rac1 commented May 8, 2016

The 57-dejavu-sans.conf looks standard. I did a number of tests with @edgemaster in #29 to test this fontconfig, but I've personally only used it on Ubuntu/Fedora. The problem probably is, as you can see, something in your fontconfig is identifying Bitstream Vera incorrectly as DejaVu:

Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

You could try changing the 56 to another number??? The output on your system needs to match the expected file. You can do tests with fc-match sans | head -n2 or similar to determine what is different in your fontconfig.

(I'm amazed how much hassle fontconfig has been. I thought making the font itself was going to be the most difficult part.)

@IgnoredAmbience
Copy link

Do you also have ttf-bitstream-vera installed? I've only got it marked as an optional dependency ("for bug-free font fallback") due to a previous comment on the AUR page complaining that it was a mandatory installation.

@13rac1
Copy link
Owner

13rac1 commented May 18, 2016

Ah ha! YES. Bitstream Vera is required to use the provided fontconfig. It is required in my Launchpad PPA.

To keep DejaVu, such in #36, the (only?) solution is to manually subset DejaVu to remove all emoji characters using NotoTools.

Ideal long term solution: DejaVu must be modified to keep all Unicode Emoji out of the default font like the default Windows and OS X font families. Edit: Maybe add a DejaVu Emoji font separately.. IDK

@IgnoredAmbience
Copy link

Released 1.0-2 to AUR with ttf-bitstream-vera as a required dependency. Apologies for missing this previously.

@13rac1
Copy link
Owner

13rac1 commented May 18, 2016

Great! There are many options to create custom fontconfigs or subset fonts, but I want to provide a general "just works" for most users. Advanced users know what to do.

@13rac1
Copy link
Owner

13rac1 commented May 19, 2016

@TamasBarta Can you confirm if BitstreamVera is installed?

@TamasBarta
Copy link
Author

Sorry for being unavailable lately. I have BitstreamVera installed, and DejaVu as well. The packages I have installed (for those familiar with Arch) are ttf-dejavu and ttf-bitstream-vera.
Also I installed the latest version of edgemaster's package from AUR, but that made no difference.

@13rac1
Copy link
Owner

13rac1 commented May 20, 2016

I've installed Evolution on my machine (Ubuntu 14.04) version: 3.10.4 and have reproduced this issue. Steps to reproduce:

  1. Install evolution
  2. Start evolution and skip setup wizard
  3. Create a new email
  4. Type some characters
  5. Save the Draft
  6. View the Draft in the preview pane.

DejaVu being selected instead of Vera by your fontconfig is a separate issue:

Vera.ttf: "DejaVu Sans" "Roman"                                 |  Vera.ttf: "Bitstream Vera Sans" "Roman"

@13rac1 13rac1 changed the title Cannot use Cantarell in Evolution together with emojione's fontconfig Supplied fontconfig causes serif font to be used in Evolution Preview Pane May 20, 2016
@13rac1
Copy link
Owner

13rac1 commented Jun 7, 2016

Note, this issue is open until I add it to both emoji font readme files. AFAIK there's nothing I can do in the font file or fontconfig to change this. A bug report should be opened against Evolution regarding it.

@13rac1 13rac1 closed this as completed in 9348476 Jun 10, 2016
13rac1 added a commit that referenced this issue Jun 10, 2016
Multiple Linux programs are parsing the provided fontconfig
incorrectly or the fontconfig is incorrect.

The problem is, probably, related to the definition of the fontconfig
edit mode "prepend_first". Either way, until a solution can be found
these characters and therefore associated ligatures will be disabled.

Fixes #35, fixes #37, fixes #39 and creates #40.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants