[poppler] What is the best way of comparing two GfxFont instances?

Adrian Perez de Castro aperez at igalia.com
Wed Dec 4 10:05:57 PST 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20131204/6fb3036f/attachment.pgp>


More information about the poppler mailing list