Skip to content

Conversation

@ellert
Copy link
Contributor

@ellert ellert commented Sep 21, 2015

This is a pull request based on the patches in https://sft.its.cern.ch/jira/browse/ROOT-7457

There are two problem with the code. Looking at a hexdump of a Type 1 font:

00000000 80 01 fb 15 00 00 25 21 50 53 2d 41 64 6f 62 65 |......%!PS-Adobe|
00000010 46 6f 6e 74 2d 31 2e 30 3a 20 53 74 61 6e 64 61 |Font-1.0: Standa|
[ ... ]
00008390 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0d 63 |00000000000000.c|
000083a0 6c 65 61 72 74 6f 6d 61 72 6b 0a 80 03 |leartomark...|

The code currently reads beyond the 80 03 at the end of the file by trying to determing the length of the following block - but an end of file block does not have a length, the file ends right after the end of file block tag 08 03.

The length is in little endian format - as can be seen in the beginning of the file. The ascii block tag 80 01 is followed by fb 15 00 00 which is little endian for 000015fb. So it is big endian architectures that needs to do a byte swap, not little endian ones as in the current code.

The first attached patch addresses these issues. The second patch implements returning the fontname for Type 1 embedding.

@couet
Copy link
Member

couet commented Sep 21, 2015

Hello,

I have tried to take your latest version of fontembedps.cxx, but for me it does not compile. Can you send me a diff against the ROOT master ?

@ellert
Copy link
Contributor Author

ellert commented Sep 21, 2015

If I check out the master and apply the changes from this pull request, then doing configure and make (without any other patches applied) works for me (Fedora 22, gcc-c++-5.1.1-4.fc22.x86_64).
What errors do you get?

@couet
Copy link
Member

couet commented Sep 21, 2015

I am using cmake and get some errors (I cannot retry now because I am busy with something else).

May be I did some mistake applying the changes.

Can you send me the modified file ?
it is quite small …

Thanks.
Olivier

On 21 Sep 2015, at 17:05, ellert notifications@github.com wrote:

If I check out the master and apply the changes from this pull request, then doing configure and make (without any other patches applied) works for me (Fedora 22, gcc-c++-5.1.1-4.fc22.x86_64).
What errors do you get?


Reply to this email directly or view it on GitHub #90 (comment).

@ellert
Copy link
Contributor Author

ellert commented Jan 9, 2016

This branch should still merge without conflicts, so I don't know what went wrong.
Anyway - here is the complete file. (I had to add .txt to the filename since attachments with .cxx extensions were not allowed.)
fontembedps.cxx.txt

@couet
Copy link
Member

couet commented Jun 21, 2016

This version of fontembedps.cxx is now in the master.

@couet couet closed this Jun 21, 2016
@ellert ellert deleted the ROOT-7457 branch June 21, 2016 16:16
omazapa pushed a commit to oprojects/root that referenced this pull request Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants