Re: Custom font help?


Jeremy Hughes
 

Hi Keith,

This overlaps with my previous reply, but you can specify several weights in the URL.

This works for me:

https://fonts.googleapis.com/css2?family=Alegreya+Sans:wght@400;900&display=swap

I pasted the following text from Google’s Embed tab, after selecting Regular and Black 900 on the Alegreya Sans page:

<link href="https://fonts.googleapis.com/css2?family=Alegreya+Sans:wght@400;900&display=swap" rel="stylesheet”>

One difference that I see between Xway and browsers is that Xway displays a less bold version of the font. This is because Xway chooses a less bold weight (following CSS “bolder”) that is not available to the browsers. To get the same font in Xway and browsers you could select 900 in the Weight popup (default style for Heading1).

I also found that the font was updated in Xway after I switched pages and back (following up from your previous email).

Jeremy

On 15 May 2020, at 15:34, ThatKeith via groups.io <Thatkeith=mac.com@groups.io> wrote:

I'd like to use a specific Google web font, Alegreya Sans, for both body text (regular weight) and headlines (the heaviest '900' weight).
How should I set this up? I have created a custom font with the correct font name, added alternatives, set the type, and set the font URL (https://fonts.googleapis.com/css2?family=Alegreya+Sans).

But how should I specify the weight? If I set Bold, 900 or Bolder in the Document: Default Styles for Header 1 it doesn't make any difference in Xway or the browser. If I apply Bold, 900 or Bolder directly to the header 1 text this looks correct in Xway but doesn't translate to the chunky weight in a browser; it looks faintly bolder, like Medium vs Regular.

If I add ":wght@900" to the end of the custom font URL this works, but of course it makes ALL text set in that typeface to be ultra-bold. I tried setting up two different custom font entries, one with 900 set, but the font name can't be identical for two entries, and it's what references the actual typeface so can't be different. :-O

Join xway-talk@softpress.groups.io to automatically receive all group messages.