Feature Request - Custom Fonts in Themes

Hi,

Ive created an HTML theme for our invoices (http://www.thoroughhorticulture.com.au/docs/invoice.html), and it employs Google Fonts to keep our invoices looking crisp and clean.

Unfortunately I cant find a way to use this invoice (as it looks) in Manager unless I save the invoice theme as a A4-sized .PNG background image to the Manager Invoice Theme, however all the data that goes into that theme once compiled appears in system fonts and not at all inline with the original theme using Google Fonts.

John.

Manager doesn’t currently support some font-family attributes of Liquid/HTML. I’m fairly certain you are out of luck with Google Fonts.

The latest version (18.9.52) supports font-family style for PDF generation.

For example I can set style attribute to font-family: Agency FB

which will make my invoice look like this:

Of course you can have multiple fonts within single PDF document. You just need to set font-family on relevant HTML tags.

Also, font has to be installed on your machine for now. No external font loading yet.

1 Like

Just a few questions. Where should we load the fonts on the server version? How do we get the name of the Font Family? Is it the name of the file.ttf?

That depends on your operating system. Same place as other fonts.

Yes, but without the .ttf extension.

thanks Lubos. this will lead to better customization!

@Davide, fonts need to be installed on the system.

For example, on Windows 10 to install the font, you’d double-click on TTF file.

install

Then click Install button which will place the font in your Fonts list.

To find out the name of the font, click on the desired font and find its Full name under Metadata section.

metadata

@lubos thank you for this feature addition.

i have a small problem now as my custom themes are using system default fonts for the pdf. i could specify a different font family of my choice in my custom theme but it would be too much work as i will have to change the font size and alignments too.

so can you please share a link to the original Google Noto font used by the pdf generator previously. there seems to be more than 75 varieties of them on Google Fonts

@sharpdrivetek Manager was using Open Sans (the first one in the list). There are lots of specimens, you just need to install Open Sans Regular and Open Sans Bold.

However, why Arial font (which is now the default) is not acceptable? It’s looking almost the same as Open Sans.

thank you @lubos
will try installing them and get back if all is not back to normal.

like you said its almost the same. :smiley: depending on the quantity of text there is a lot of visual difference as to how the fonts are placed and their alignments wrt the font size.

@lubos

Installed the first one on the lsit from google and i am not sure why but the Noto Sans font does not seem to work with the pdf. it does display correctly in Manager view. the fonts i installed were the Noto Sans Regular and Noto Sans Bold. also tried installing all the fonts available in the package still no luck.
I also tried Courier Standard font which does not seem to work either. In both cases the fonts were replaced by some random fonts when generating pdf.

Some default fonts like Comic Sans MS, Times New Roman seem to work perfectly.

I am not sure what causes this issue.

image

I have the same issue

What @sharpdrivetek and @Frankie describe sounds like it may be similar to Microsoft’s unwillingness to recognize third-party fonts in its programs. There has been some discussion of this in another forum topic, within the last month I think.

My experience with a Linux environment under Docker and Courier Font Family went fine at first strike.

Thanks @lubos

Try font-family: Noto Sans Regular instead of just Noto Sans

Tried the same on 18.10.9 and still no luck. the fonts were different in PDF.
but Noto Sans worked on the latest version. the only issue was the currency symbol (Indian Rupee) not showing up with Bold text.
also had some issues with column sizes the first time pdf was generated. this did not happen the second time. i am not sure what caused this inconsistency.
anyway now I am using the Arial Unicode MS font which seems to work as of now and looks more similar to earlier Noto font used by Manager (just my view though).

@lubos would it be possible for Manager to generate PDF with its earlier default Noto font when no specific fonts are defined in a custom theme. this is because all the old docs now seem a bit different with the font sizes and their placement. not all fonts appear the same size and also their letter spacing even when these have not been changed.

1 Like

I agree with what @sharpdrivetek said. The Noto fonts should be brought back to the installation package. It would increase the file size of the download, but seems like a necessity. Also data and storage both are getting drastically cheaper… no no issues from the users.
The don’t fix it if it ain’t broken principle is to be followed.

Noto fonts are back in installation package and are used by default.

3 Likes