organic wrote:The used font doesn't support all characters. If your font is not supported, then you can use any other Unicode font. Just copy it into \App_Data\Pdf directory.
P.S. I know what ArialUni.ttf font (provided with MS Office) support almost languages, but we can't distribute it with nopCommerce because it's not allowed (not open source).
Hi, I copied ARIALUNI.TTF to the folder. It didn't work.
And I changed pdf file to ARIALUNI.TTF at line 4455 in installationService.cs file.
EngineContext.Current.Resolve<IConfigurationProvider<PdfSettings>>()
.SaveSettings(new PdfSettings()
{
Enabled = true,
LetterPageSizeEnabled = false,
RenderOrderNotes = true,
FontFileName = "ARIALUNI.TTF", /////////////////////FontFileName = "FreeSerif.ttf",
});
Still doesn't work. please let me if I mssed anything?
I think that "SaveSettings" method of "installationService.cs" runs during installation. If you want to change a default font after installation, you need to change "GetFont" method in PdfService.cs like as follows.
protected virtual Font GetFont()
{
//nopCommerce supports unicode characters
//nopCommerce uses Free Serif font by default (~/App_Data/Pdf/FreeSerif.ttf file)
//It was downloaded from http://savannah.gnu.org/projects/freefont
//string fontPath = Path.Combine(HostingEnvironment.MapPath("~/App_Data/Pdf/"), _pdfSettings.FontFileName);
string fontPath = Path.Combine(HostingEnvironment.MapPath("~/App_Data/Pdf/"), "ArialUni.ttf");
var baseFont = BaseFont.CreateFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
var font = new Font(baseFont, 10, Font.NORMAL);
return font;
}