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

Using fonts #7

Open
UplinkPhobia opened this issue Oct 26, 2020 · 2 comments
Open

Using fonts #7

UplinkPhobia opened this issue Oct 26, 2020 · 2 comments

Comments

@UplinkPhobia
Copy link

Hello,

Could you help me with the fonts? I tried using them, but I can't get them to work, so I guess I'm using them wrong...

@satrix321
Copy link
Owner

satrix321 commented Oct 26, 2020

Hi,
To change the font for some specific type of text, you need to add a style block with a font-face that has the correct 'font-family' property. In the menu there are command to insert preconfigured font snippets, after inserting them you should change the 'src' attribute to your specified font and any other required params. The most important thing is that the font-family name needs to stay the same.

Below is a short snippet, where I took a font from Google Fonts and used it to replace the regular text font:

\page[columns-2]

<style>
@font-face {
	font-family: "regular-text";
	font-style: normal;
	font-weight: 400;
  font-display: swap;
  src: local('Turret Road Regular'), local('TurretRoad-Regular'), url(https://fonts.gstatic.com/s/turretroad/v2/pxiAypMgpcBFjE84Zv-fE0tCMPKhSkFE.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
</style>

Turret Road font from google fonts.

obraz

obraz

@UplinkPhobia
Copy link
Author

UplinkPhobia commented Oct 26, 2020

Thanks for the quick answer.

My problem was working with a local font, but as I was fiddling with the editor I got it to work. For some reason, the font I was trying to use works a bit weirdly.

As a reference if anyone is as much of a noobie as me:

I was trying to use the Z003 font (on Manjaro Linux), but after doing fc-list | grep Z003 it found a file called Z003-MediumItalic.otf
/usr/share/fonts/gsfonts/Z003-MediumItalic.otf: Z003:style=Medium Italic

For some reason, the name I needed to use in the local() field was "Z003-MediumItalic".
What is weird is that for a font like Liberation Sans, for example, the name "Liberation Sans" works, without the need to use a specific variant (e.g. "LiberationSans-Italic"). I don't really know why this difference exists.

One question though: is there a similar way to change the font size for, let's say, the regular-text font?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants