Hi all,
please don't hold off on accepting my patch for the reason
that makes dealing with font flags harder, or creates a
deviation for CreateBase14Font() from the usual flag handling
for the other font methods: I'm going to write a class named
PdfFontFlags to make it as easy to handle the flags for all
methods which take a bitwise-or of EPdfFontFlags (can't this
be singular?) as it would be with type int but keep the type
safety of my already-submitted fixed patch. I'd like to submit
that new class shortly (max. some days) after you've accepted
the former patch. I plan to achieve that ease of handling with
overloaded bitwise operators (private to that class will still
be an int) and a GetBase14FontFlags(). Please tell me what you
think of this and what you need in addition to accept these two
patches.
Best regards, mabri
________________________________
From: Matthew Brincke <mabr...@ymail.com>
To: "podofo-users@lists.sourceforge.net" <podofo-users@lists.sourceforge.net>
Sent: 14:23 Sunday, 4 October 2015
Subject: Re: [Podofo-users] Method signature clarification for
PdfFontFactory::CreateBase14Font()
Hi all,
I'm so sorry to have had forgot build-testing my original
patch, it didn't build for me (with gcc4.9 on 32-bit Linux)
either, so it isn't particularly likely yours is any stricter.
I've attached a fixed patch which builds cleanly (no build log
changes, except, for some reason, "Scanning dependencies ..."
lines, I did run make clean after a practically-clean build).
Please review/accept the fixed patch because:
a) we both want type safety and this patch achieves to better it,
b) no bitwise-or of flags is required, because only the Bold,
Italic and BoldItalic flags apply for Base14 fonts and they're
mutually exclusive (if you think you need one, please use the
BoldItalic flag, since that's the only one where it would apply)
c) the PdfFontFactory::CreateBase14Font()method isn't documented
yet, so no change to the public documented API happens with this.
So if you are persuaded (I hope so), please apply the fixed patch
and commit it (separately) to the public repository, otherwise please
tell me why not.
Best regards, mabri
----- Original Message -----
From: zyx <z...@litepdf.cz>
To: podofo-users@lists.sourceforge.net
CC:
Sent: 19:28 Friday, 2 October 2015
Subject: Re: [Podofo-users] Method signature clarification for
PdfFontFactory::CreateBase14Font()
On Thu, 2015-10-01 at 21:50 +0000, Matthew Brincke wrote:
> -PdfFont *PdfFontFactory::CreateBase14Font(const char* pszFontName, int
> nFlags, const PdfEncoding * const pEncoding, PdfVecObjects *pvecObjects)
> +PdfFont *PdfFontFactory::CreateBase14Font(const char* pszFontName,
> + EPdfFontFlags eFlags, const PdfEncoding * const
> pEncoding,
> + PdfVecObjects *pParent)
Hi,
I would not change that type of nFlags, it's not a good idea:
a) I get build break due to not changed prototype in the header file
b) even if I fix it, I get a build break due to no cast from int to
the enum, for example called from PoDoFo::PdfFontCache::GetFont()
I can have set my gcc too strict, but I do not think it's that much
strict. After all, you do not pass one value of the enum, but a bit-or
of them, which the 'int' works for pretty well (or 'unsigned int' can,
in some cases with many enum values).
Bye,
zyx
--
http://www.litePDF.cz i...@litepdf.cz
------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users
------------------------------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users