I understand that iText does not come with any font programs and that you need to provide a font file. The PDFs I generate will be viewed in Adobe Reader and when I use Standard Type 1 fonts, Adobe Reader will have support for it, but my question is about licensing fonts.
- Do I need to have a license of the fonts which I am using in iText? For example if I am using Arial, one of the most commonly used fonts (but which is not free), do I need to purchase the font?
- If I using any specific font (for example STSONG.ttf for Chinese characters), do I need to have a license for this ?
Just like all software (including iText), fonts are licensed, but there are different types of licenses.
You have fonts that have an open font license like SIL which is the first that comes to mind, but there are many other licenses that allow you to use a font completely for free. Caveat: be careful with "free" fonts on the web. Many are just copies of protected fonts with their copyright notices removed.
You have fonts that are proprietary in the sense that you can not redistribute them, but they allow you to embed the font in documents. For instance: the fonts that ship with MS Windows are proprietary. You are not allowed to copy them and ship them for free, however some fonts may be embedded within document files. Embedding allows fonts to travel with documents. Embedded fonts can only be used to print, preview and in some cases edit the document in which they are embedded. (See Font redistribution and license issues in Microsoft's FAQ)
Some fonts require a full (paid) license even if you want to embed them. If I remember correctly, the fonts you can download as a font pack for Adobe Acrobat/Reader can only be used in the context of Acrobat. You are not allowed to embed them in a document using software that is not sold by Adobe.
I have different font examples in the sandbox and for every font I use, I look at the corresponding license. If you check the overview, you'll see that I have fonts with a SIL license, an Apache license, and so on... I don't know about STSONG.ttf, so you'll have to check which license applies.
You may embed the Font Software only into an electronic document that (i) is not a Commercial Product, (ii) is distributed in a secure format that does not permit the extraction of the embedded Font Software, and (iii) in the case where a recipient of an electronic document is able to Use the Font Software for editing, only if the recipient of such document is within your Licensed Unit.
However, you probably didn't obtain the font from Monotype. It was probably shipped with your legal copy of Microsoft Windows, and Monotype may have licensed its fonts to Windows under a license that is less strict.
Let's check which license applies by right clicking a font file such as arial.ttf in C:\windows\fonts and let's inspect the Properties:
Properties of arial.ttf
I am in luck: in my case, the Font embeddability says "Editable". This means that I can embed the font in a document not only to print and (pre)view the document, but also to edit the document (e.g. edit form fields) as long as I use arial.ttf in the context of the Windows license that I bought. I can not copy arial.ttf to another computer.
Note that you shouldn't assume that was always the case. For instance if we look at Arial Unicode, we see that older versions only allowed print and preview embedding, whereas editable embedding was allowed only for version 1.00 and higher. You should really check the properties of each font you are planning to use.
If you need a font that can be distributed, you should look for an alternative font that has an open font license. I use FreeSans in the sandbox examples, but there are other free alternatives.
Click this link if you want to see how to answer this question in iText 5.