troennes / quartz-theme-typora

A minimalistic theme for Typora markdown editor
MIT License
31 stars 5 forks source link

Italics and bold doesn't work #1

Closed gotjek closed 5 years ago

gotjek commented 5 years ago

Italics and bold are not shown in Typora. They appear in source code (word or word). Roboto fonts are present in ./quartz and installed. I don't really know of it's Quartz related but italics and bold work with built-in themes like "Github". I notheless do like Quartz theme, it's compact and elegant — thank you!

troennes commented 5 years ago

Do have the Roboto fonts installed locally? In that case, the theme will look for bold and italic within the font installed as "Roboto". If those are installed under another name, e.g. "Roboto-Bold", it will probably not work.

If you don't have the installed locally, it will use the 6 ttf-files in the quartz folder without installing them. This is the easiest way to make it work.

Also, what OS do you use?

gotjek commented 5 years ago

Yes, Robot fonts are installed locally. In my C:\Windows\Fonts I have :

-a---- 26/05/2017 10:20 306428 Roboto-Black.ttf -a---- 26/05/2017 10:20 330448 Roboto-BlackItalic.ttf -a---- 26/05/2017 10:21 306940 Roboto-Bold.ttf -a---- 26/05/2017 10:21 332160 Roboto-BoldItalic.ttf -a---- 26/05/2017 10:21 328640 Roboto-Italic.ttf -a---- 26/05/2017 10:21 307192 Roboto-Light.ttf -a---- 26/05/2017 10:21 332172 Roboto-LightItalic.ttf -a---- 26/05/2017 10:21 306536 Roboto-Medium.ttf -a---- 26/05/2017 10:21 330796 Roboto-MediumItalic.ttf -a---- 26/05/2017 10:22 305608 Roboto-Regular.ttf -a---- 26/05/2017 10:22 307664 Roboto-Thin.ttf -a---- 26/05/2017 10:22 329700 Roboto-ThinItalic.ttf -a---- 26/05/2017 10:22 303944 RobotoCondensed-Bold.ttf -a---- 26/05/2017 10:22 330504 RobotoCondensed-BoldItalic.ttf -a---- 26/05/2017 10:22 329372 RobotoCondensed-Italic.ttf -a---- 26/05/2017 10:22 302300 RobotoCondensed-Light.ttf -a---- 26/05/2017 10:22 332504 RobotoCondensed-LightItalic.ttf -a---- 26/05/2017 10:23 303604 RobotoCondensed-Medium.ttf -a---- 26/05/2017 10:23 330348 RobotoCondensed-MediumItalic.ttf -a---- 26/05/2017 10:23 300664 RobotoCondensed-Regular.ttf

The fonts seems to be installed as Roboto when I go to this directory in the Explorer. I click the Roboto icon and the subfiles (bold, condensed, etc.) are shown.

capture

The problem seems to be related to this. If I uninstall the local Roboto, bold and italics work. I often use Roboto in other editors. Do you know how I could use your theme in Typora and the Roboto font elsewhere?

I use Windows 10 (1803).


P.S. I modified quartz-milky.css lines 40 to 73 to this and it seems to work :

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: normal;
  src: url('./quartz/Roboto-Italic.ttf') format('truetype')
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: bold;
  src: url('./quartz/Roboto-Bold.ttf') format('truetype')
}

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: bold;
  src: url('./quartz/Roboto-BoldItalic.ttf') format('truetype')
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  src: url('./quartz/Roboto-Light.ttf') format('truetype')
}

@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 300;
  src: url('./quartz/Roboto-LightItalic.ttf') format('truetype')
}
troennes commented 5 years ago

That suggestion will work, but it will ignore your local fonts. Instead I tried to fix the local sources. It works for me now. Please let me know if this solves your problem. And thanks for reporting! See https://github.com/troennes/quartz-theme-typora/commit/c0e264491cae9fc68a9bcea210c9c9e5cdc18bab

gotjek commented 5 years ago

The new css file resolved the problem. Thank you very much for your support and your beautiful theme!