Leonard Rosenthol <[email protected]> writes: > 3 & 5 are not valid tests. They will not guarantee uniqueness.
Thanks Leonard, I am sticking with comparing the IDs for the fonts. I did some tests more and just comparing the IDs does the right thing. Cheers, -Adrian > On 12/4/13 6:05 PM, "Adrian Perez de Castro" <[email protected]> wrote: > >> >>Hello to all, >> >>What is the best way of knowing whether two GfxFont instances are >>actually the same font? I have a tentative implementation that works >>fine in tests, and I would like to know whether it is correct. It >>works like this: >> >> 1. If the pointers to the GfxFonts are the same, then it is >> the same font. >> 2. (else) If the Ref returned by GfxFont::getID() for the two >> fonts is the same num/gen pair, then it is the same font. >> 3. (else) If the font tags returned by GfxFont::getTag() are >> the same, then it is the same font. >> 5. (else) If the names returned by GfxFont::getName() are the >> same, then it is the same font. >> 6. (else) The fonts are different. >> >>My main concern is that it seems that comparing the tag seems to >>be enough, and maybe some comparisons can be removed. Also, in >>case the additional comparisons are needed, is the font name a >>good discriminator? >> >>Thanks in advance, >> >> >>-Adrian >> > > -- -Adrian
pgpp3p0vslnjE.pgp
Description: PGP signature
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
