Welcome Guest Search | Active Topics | Sign In | Register

Problem with custom fonts in the pdf from html Options
Dimitry
Posted: Saturday, October 22, 2011 11:50:51 AM
Rank: Newbie
Groups: Member

Joined: 10/22/2011
Posts: 9
Hello, I use the library EO.pdf in my asp.net project but I have one problem when I am trying to create pdf from html page and use my custom font I got generated any pdf file without my font.
Have you any ideas?

Regards, Dimitry.
eo_support
Posted: Saturday, October 22, 2011 11:55:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Make sure your custom font is a TrueType font. We get the font data from Windows and Windows will only give us TrueType font. Windows can handle other types of fonts but it won't give those font data to us. As a result, whenever you use a non TrueType custom font, the font will be substituted with a "default" true type font (which usually is Microsoft Sans Serif).

Thanks!
Dimitry
Posted: Saturday, October 22, 2011 12:30:04 PM
Rank: Newbie
Groups: Member

Joined: 10/22/2011
Posts: 9
Thanks very much for your quick response. I use a JamesFajardo.ttf font it is TrueType font. I did installed it in my Windows. But it isn't working.

Regards, Dimitry.
eo_support
Posted: Saturday, October 22, 2011 12:34:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

In that case please create a small test project that demonstrates the problem, and send the test project along with the font file to us in zip format (we will PM you as to where to send them). Once we have that, we will run it here and see what we can find. As long as we can reproduce the problem, we should be able to tell you what's wrong.

Thanks!
eo_support
Posted: Saturday, October 22, 2011 2:26:00 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We looked into your test project. You cannot use custom font that way. The font must be installed with windows (because we get font data from Windows, not from your font file). So the steps to use custom font are:

1. Install the font with windows. You can do this by directly pasting "JamesFajardo.ttf" into Windows "Font" folder;
2. Use "James Fajardo" directly in your CSS. For example:

Code: CSS
body   
{
    background: #b6b7bc;
    font-size: 40px;
    font-family: 'James Fajardo';
    margin: 0px;
    padding: 0px;
    color: #ffffff;
}


Note the font-family name is 'James Fajardo', not 'JamesFajardo'.

Hope this helps. Please let us know if you have any more questions.

Thanks!
Dimitry
Posted: Saturday, October 22, 2011 2:41:58 PM
Rank: Newbie
Groups: Member

Joined: 10/22/2011
Posts: 9
But I had installed this font with my Windows and it doesn't work...
Many Thanks!
Dimitry
Posted: Saturday, October 22, 2011 2:49:08 PM
Rank: Newbie
Groups: Member

Joined: 10/22/2011
Posts: 9
eo_support wrote:
Hi,

2. Use "James Fajardo" directly in your CSS. For example:

Code: CSS
body   
{
    background: #b6b7bc;
    font-size: 40px;
    font-family: 'James Fajardo';
    margin: 0px;
    padding: 0px;
    color: #ffffff;
}


Note the font-family name is 'James Fajardo', not 'JamesFajardo'.



I did declare this name in a rule
Code:
@font-face
    {
        font-family: JamesFajardo;
        src: url('JamesFajardo.eot');
        src: local('JamesFajardo'), url('JamesFajardo.ttf') format('TrueType');
    }


It is working in my html.
eo_support
Posted: Saturday, October 22, 2011 2:49:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
We tested it here and it does work. It doesn't work for you because you used "JamesFajardo" in your Style.css. It should be "James Fajardo".

Thanks
eo_support
Posted: Saturday, October 22, 2011 2:53:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Please do the following:

1. Remove your @font-face block.
2. Use the correct font name (there is a space in the two words).

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.