You are not logged in.

#1 2012-12-30 21:23:18

coproduct
Member
Registered: 2011-09-30
Posts: 22

[SOLVED] Web browser won't use (or can't find) Helvetica font

I'm currently using Gnome 3.6.2, Firefox 17.0.1, and Chromium 23.0.1271.97.

Many sites that I visit use a Helvetica font variant: Helvetica, Helvetica Neue, or Helvetica World.
However, it seems as though the actual names of these fonts vary depending on where they were purchased.
For example, you will find the following names scattered across the internet:
- Helvetica Std
- Helvetica LT
- Helvetica LT Std
- Helvetica LT Com
and so forth...  and this includes the variants as well.
Nowhere, including the Adobe website, have I found just "Helvetica" alone.
However, I'm not a font expert and this may not matter. 
The family "Helvetica" may be specified within the font itself.
Yet, this does not seem to be the case because although I have Helvetica LT Std installed, no browser will render it for just "Helvetica".
I tried creating the following font alias:

   <alias>
       <family>Helvetica</family>
       <prefer><family>Helvetica LT Std</family></prefer>
       <default><family>fixed</family></default>
   </alias>

But that does not work.
Where am I going wrong?

I'd also like to note that Firebug on Firefox is the only web developer tool that will show which font is actually being rendered on the page, as opposed to just listing the css rule.

Last edited by coproduct (2013-07-28 01:35:38)

Offline

#2 2012-12-30 22:45:47

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

    <!-- Replace bitmap Helvetica -->
    <match target="pattern">
        <test name="family" compare="contains">
            <string>Helvetica</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Helvetica LT Std</string>
        </edit>
    </match>
$ fc-match Helvetica
helveticaltstd-roman.otf: "Helvetica LT Std" "Roman"

$ fc-match "Helvetica Neue"
helveticaltstd-roman.otf: "Helvetica LT Std" "Roman"

$ fc-match "Helvetica LT Com"
helveticaltstd-roman.otf: "Helvetica LT Std" "Roman"

Edit: This makes it so I never see any version of Helvetica except for the one I prefer.

Last edited by thisoldman (2012-12-30 22:53:14)

Offline

#3 2012-12-30 23:49:44

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

Thanks for the reply,

That should work but for some reason Firefox won't budge.  I also tried using the match example from the Font Configuration wiki page, which is slightly different, but to no avail.

Offline

#4 2012-12-31 00:02:16

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

Depending on what Helvetica subtype you have, create an alias like this:

<match target="pattern">
  <test name="family">
    <string>Helvetica</string>
  </test>
  <edit name="family" mode="prepend" binding="strong">
    <string>Helvetica LT Std</string>
  </edit>
</match>
<match target="font">
  <test name="family">
    <string>Helvetica</string>
  </test>
  <edit name="family" mode="assign">
    <string>Helvetica LT Std</string>
  </edit>
</match>

By the way, Helvetica Neue is not exactly another trade name for the generic Helvetica; it's a modern variant that may be used alongside Helvetica itself, not actually replacing it.

Last edited by bohoomil (2012-12-31 00:03:33)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#5 2012-12-31 01:19:29

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

bohoomil wrote:

By the way, Helvetica Neue is not exactly another trade name for the generic Helvetica; it's a modern variant that may be used alongside Helvetica itself, not actually replacing it.

Right, I'm not looking to replace each variant with Helvetica, but if I know how to create an alias for Helvetica I can do the same for the others.  The above snippet didn't work for me either, it continues to default to sans-serif.  I think I may have to resort to copying over the Helvetica.ttf file on my macbook, assuming that's possible.

Offline

#6 2012-12-31 01:27:49

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

coproduct wrote:

I think I may have to resort to copying over the Helvetica.ttf file on my macbook, assuming that's possible.

Excuse me, do you mean you have not any Helvetica typeface installed yet? What is the output of

fc-list | grep Helvetica

in the first place?


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#7 2012-12-31 02:06:06

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

bohoomil wrote:
coproduct wrote:

I think I may have to resort to copying over the Helvetica.ttf file on my macbook, assuming that's possible.

Excuse me, do you mean you have not any Helvetica typeface installed yet? What is the output of

fc-list | grep Helvetica

in the first place?

No, that's not at all what I mean.  If you read the first post, then you'd realize that I'm struggling with getting Firefox to use something like 'Helvetica LT Std' in place of 'Helvetica' or 'Helvetica Neue LT Com' in place of 'Helvetica Neue'.  I'm now resorting to simply copying over 'Helvetica.ttf' under the assumption that it will provide simply 'Helvetica' without the 'LT whatever...' .

$ fc-list | grep Helvetica 
/usr/share/fonts/OTF/HelveticaLTStd-BoldCondObl.otf: Helvetica LT Std,Helvetica LT Std Cond:style=Bold Condensed Oblique,Bold Italic
/usr/share/fonts/TTF/HelveticaNeueLTCom-LtCnO.ttf: Helvetica Neue LT Com,HelveticaNeueLT Com 47 LtCn:style=47 Light Condensed Oblique,Italic
/usr/share/fonts/OTF/HelveticaLTStd-Bold.otf: Helvetica LT Std:style=Bold
/usr/share/fonts/OTF/HelveticaLTStd-ExtraComp.otf: Helvetica LT Std,Helvetica LT Std ExtCompressed:style=Extra Compressed,Regular
/usr/share/fonts/TTF/HelveticaNeueLTCom-ThExO.ttf: Helvetica Neue LT Com,HelveticaNeueLT Com 33 ThEx:style=33 Thin Extended Oblique,Italic
/usr/share/fonts/TTF/HelveticaNeueLTCom-BdCnO.ttf: Helvetica Neue LT Com,HelveticaNeueLT Com 57 Cn:style=77 Bold Condensed Oblique,Bold Italic
/usr/share/fonts/TTF/HelveticaNeueLTCom-HvExO.ttf: Helvetica Neue LT Com,HelveticaNeueLT Com 63 MdEx:style=83 Heavy Extended Oblique,Bold Italic
/usr/share/fonts/OTF/HelveticaLTStd-BlkObl.otf: Helvetica LT Std,Helvetica LT Std Black:style=Black Oblique,Italic
/usr/share/fonts/TTF/HelveticaNeueLTCom-Md.ttf: Helvetica Neue LT Com,HelveticaNeueLT Com 65 Md:style=65 Medium,Regular
ETC....

Offline

#8 2012-12-31 02:17:13

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

OK, I was just confused what was actually going on... The method of creating aliases I presented to you above works for me very well. You may need to place the rule before any other that may alter the substitution (or if you wish to use Helvetica as your default sans-serif face). If so, put the substitution in a file named, say, 09-helvetica.conf in /etc/fonts/conf.d/ and check the results. If you wish to make Helvetica your default sans-serif font using the generic name, modify /etc/fonts/conf.d/45-latin.conf accordingly placing

<alias>
  <family>Helvetica</family>
  <default><family>sans-serif</family></default>
</alias>

on top of the list, the 'Sans-serif faces' part of it. This way it will be given a higher priority over other sans-serif fonts.

Last edited by bohoomil (2012-12-31 02:21:05)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#9 2013-01-01 04:54:37

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

bohoomil wrote:

OK, I was just confused what was actually going on... The method of creating aliases I presented to you above works for me very well. You may need to place the rule before any other that may alter the substitution (or if you wish to use Helvetica as your default sans-serif face). If so, put the substitution in a file named, say, 09-helvetica.conf in /etc/fonts/conf.d/ and check the results. If you wish to make Helvetica your default sans-serif font using the generic name, modify /etc/fonts/conf.d/45-latin.conf accordingly placing

<alias>
  <family>Helvetica</family>
  <default><family>sans-serif</family></default>
</alias>

on top of the list, the 'Sans-serif faces' part of it. This way it will be given a higher priority over other sans-serif fonts.

Creating a rule (09-helvetica.conf) before the others worked, thanks.  I was using ~/.config/fontconfig/fonts.conf previously.

Offline

#10 2013-07-28 00:49:11

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

Well, for some reason this solution stopped working.
Here is my current ~/.config/fontconfig/fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="embeddedbitmap" mode="assign">
      <bool>false</bool>
    </edit>
  </match>
  <match target="pattern">
    <test qual="all" name="family" target="default" compare="eq">
      <string>Helvetica</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>Helvetica LT Std</string>
    </edit>
  </match>
</fontconfig>

I tried creating a separate ~/.config/fontconfig/conf.d/09-helvetica.conf, and one in /etc/fonts/conf.d without any luck.

Offline

#11 2013-07-28 00:58:11

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

Try substituting the font using the following template:

  <match target="font">
    <test name="family">
      <string>FONT TO REPLACE 1</string>
    </test>
    <edit name="family" mode="assign">
      <string>REPLACEMENT FONT 1</string>
    </edit>
  </match>
  <match target="pattern">
    <test name="family">
      <string>FONT TO REPLACE 1</string>
    </test>
    <edit name="family" mode="prepend" binding="strong">
      <string>REPLACEMENT FONT 1</string>
    </edit>
  </match>

:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#12 2013-07-28 01:28:32

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

I went ahead and used your template but this may have something to do with Gnome, because fontconfig does seem to be aware of the change:

 
$ fc-match Helvetica
HelveticaLTStd-Roman.otf: "Helvetica LT Std" "Roman"

Yet, the browsers still end up using sans-serif.  However, this was working as expected some months ago.

Actually, after experimenting a bit, I now believe that Helvetica is actually being rendered in the browser but Firebug no longer recognizes the change.

Last edited by coproduct (2013-07-28 01:35:12)

Offline

#13 2013-07-28 01:47:52

progandy
Member
Registered: 2012-05-17
Posts: 2,143

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

coproduct wrote:

Actually, after experimenting a bit, I now believe that Helvetica is actually being rendered in the browser but Firebug no longer recognizes the change.

There is a simple test: Create a simple html page with some text, make a screenshot with both configurations in a lossless format and then compare them pixel by pixel.

Offline

#14 2013-07-28 02:00:44

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,676

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

Firefox's builtin Element Inspector can tell you the actual font being used in the "Fonts" tab.
For me, I had to remove /etc/fonts/conf.d/29-replace-bitmap-fonts.conf to have my Helvetica alias work.


This silver ladybug at line 28...

Offline

#15 2013-07-28 02:12:53

coproduct
Member
Registered: 2011-09-30
Posts: 22

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

progandy wrote:
coproduct wrote:

Actually, after experimenting a bit, I now believe that Helvetica is actually being rendered in the browser but Firebug no longer recognizes the change.

There is a simple test: Create a simple html page with some text, make a screenshot with both configurations in a lossless format and then compare them pixel by pixel.

Yeah, clearly Helvetica Neue is being used: Screenshot_from_2013_07_27_21_03_10.jpg

progandy wrote:

Firefox's builtin Element Inspector can tell you the actual font being used in the "Fonts" tab.
For me, I had to remove /etc/fonts/conf.d/29-replace-bitmap-fonts.conf to have my Helvetica alias work.

Yep, the builtin Element Inspector does indeed show the expected fonts while Firebug does not.  Must be a bug.  Also, to resolve the 29 conf I used a 09 prefix.

Offline

#16 2013-07-28 02:29:35

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [SOLVED] Web browser won't use (or can't find) Helvetica font

There is a nice little tool for Firefox I've been using on a daily basis for quite a long time: Font Finder. It is pretty useful if you want to check what font is being used or, for instance, replace one temporarily with a different family. I think you may find it handy, too.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

Board footer

Powered by FluxBB