On 05/02/11 13:20, Mark Storer wrote:
>> IIUC, then instead of the change I made, I could have make 
>> this change (to book/src/part1/chapter02/DirectorPhrases2.java):
>>
>>   timesbd = FontFactory.getFont("timesbd");
>>
>>   times = FontFactory.getFont("times");
>>
>> Is that right?
> 
> If you've already called FontFactory.registerDirectories(), then yes.
> 
> 
> --Mark Storer
>   Senior Software Engineer
>   Cardiff.com
>  
[snip]
Tried it but FontFactor.getFont produces a Font but the target,
timesbd, is a BaseFont; so, I'm getting the errors:

--{--cut here--
ant -f examples.xml execute
Buildfile: examples.xml

compile:

compile:
    [javac] Compiling 4 source files to /home/evansl/prog_dev/itext/book/bin
    [javac]
/home/evansl/prog_dev/itext/book/src/part1/chapter02/DirectorPhrases2.java:40:
incompatible types
    [javac] found   : com.itextpdf.text.Font
    [javac] required: com.itextpdf.text.pdf.BaseFont
    [javac]             timesbd = FontFactory.getFont("timesbd");
    [javac]                                          ^
    [javac]
/home/evansl/prog_dev/itext/book/src/part1/chapter02/DirectorPhrases2.java:42:
incompatible types
    [javac] found   : com.itextpdf.text.Font
    [javac] required: com.itextpdf.text.pdf.BaseFont
    [javac]             times = FontFactory.getFont("times");
    [javac]                                        ^
--}--cut here--

So, to get this to work, I'd have to change all the BaseFont's
to Fonts.  That seems too risky for someone like me who's such
a novice at this.  I would think it would be easier to
supply a:

  static const String FONTDIR=???;

and use that with the string concatenation operator, +, to
reproduce, as close as possible, the code as it is now.

Or maybe there's something else I'm missing that
you could point out for me.

TIA.

-Larry



------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to