Page 14 of 32

Re: PurePDF Version 2.0

Posted: Thu Aug 04, 2011 10:22 pm
by DoubleDutch
Yep - I'd misread the code - sorry.

Overloading - With TailBite when i did XConsole I had this bit of code:

Code: Select all

ProcedureDLL XOpenConsole()
  Flags=#PB_Window_TitleBar|#PB_Window_SystemMenu|#PB_Window_BorderLess|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget
  CX=80
  CY=25
  FontH=24
  Intensity=128
  result=XGlobalOpenConsole(50,50,640,480,"ConsoleX")
  XGlobalConsoleColor(#MyWhite,#MyBlack)
  XGlobalClearConsole()
  ProcedureReturn result
EndProcedure

ProcedureDLL XOpenConsole2(sizex,sizey)
  Flags=#PB_Window_TitleBar|#PB_Window_SystemMenu|#PB_Window_BorderLess|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget
  CX=sizex
  CY=sizey
  FontH=24
  Intensity=128
  result=XGlobalOpenConsole(50,50,640,480,"ConsoleX")
  XGlobalConsoleColor(#MyWhite,#MyBlack)
  XGlobalClearConsole()
  ProcedureReturn result
EndProcedure

ProcedureDLL XOpenConsole3(sizex,sizey,sized,fontname$,fontsize,title$)
  Itensity=128
  result=XFullOpenConsole(sizex,sizey,sized,fontname$,fontsize,title$)
  XGlobalConsoleColor(#MyWhite,#MyBlack)
  XGlobalClearConsole()
  ProcedureReturn result
EndProcedure
  
ProcedureDLL XOpenConsole4(sizex,sizey,x,y,w,h,title$)
  Flags=#PB_Window_TitleBar|#PB_Window_SystemMenu|#PB_Window_BorderLess|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget
  CX=sizex
  CY=sizey
  FontH=24
  Intensity=128
  result=XGlobalOpenConsole(x,y,w,h,title$)
  XGlobalConsoleColor(#MyWhite,#MyBlack)
  XGlobalClearConsole()
  ProcedureReturn result
EndProcedure

ProcedureDLL XOpenConsole5(sizex,sizey,x,y,w,h,title$,Flgs)
  Flags=Flgs
  CX=sizex
  CY=sizey
  FontH=24
  Intensity=128
  result=XGlobalOpenConsole(x,y,w,h,title$)
  XGlobalConsoleColor(#MyWhite,#MyBlack)
  XGlobalClearConsole()
  ProcedureReturn result
EndProcedure
Look at console 3 and 4 parameters - they are different types - yet it worked! With the correct one being selected. It is like overloading on other systems.

Re: PurePDF Version 2.0

Posted: Thu Sep 15, 2011 11:53 pm
by ABBKlaus
i finally made it work :lol:

Here´s a testversion of PurePDF that supports basic unicode capability´s :

http://www.purebasicpower.de/downloads/PurePDF.pb
http://www.purebasicpower.de/downloads/PurePDF_res.pb

And the example :

http://www.purebasicpower.de/downloads/ ... 20World.pb

Hint1 : You need to enable unicode mode in compilersettings ;-)
Hint2 : You must remove any versions of the PurePDF library before testing this one
Hint3 : Its now possible to use the PurePDF sources as includefile, just set #PurePDF_Include=1 and use IncludeFile "PurePDF.pb" to include it. The same technique is used in "Tutorial32 Unicode.pb"

BR Klaus

Re: PurePDF Version 2.0

Posted: Fri Sep 16, 2011 11:00 am
by c4s
ABBKlaus wrote:Hint3 : Its now possible to use the PurePDF sources as includefile, just set #PurePDF_Include=1 to something and it will be included
Does it mean I don't have to use it as a Userlib any longer? If so, thanks! :D

Re: PurePDF Version 2.0

Posted: Fri Sep 16, 2011 7:50 pm
by DoubleDutch
ABBKlaus: Thanks for this, it's very useful. :D

Re: PurePDF Version 2.0

Posted: Fri Sep 16, 2011 8:27 pm
by DoubleDutch
Possible bug, see screenshot:

http://xn--o-10a3f.com/images/purepdf.jpg

or

http://ɯoɔ.com/images/purepdf.jpg

The screen has the error line and the details from the debug window.

Re: PurePDF Version 2.0

Posted: Fri Sep 16, 2011 9:11 pm
by ABBKlaus
c4s wrote:Does it mean I don't have to use it as a Userlib any longer? If so, thanks! :D
Exactly !
DoubleDutch wrote:ABBKlaus: Thanks for this, it's very useful. :D
Thanks
DoubleDutch wrote:Possible bug, see screenshot:
Thanks for testing ! (It was due to the conversion from unsigned to long, i always forget to append &$FFFF)
its Fixed now, please redownload the sources

- fixed escaping of characters BS / TAB / LF / FF / CR / Backslash '\' / '(' / ')'
- fixed pdf_GetStringWidth() for unicode characters

BR Klaus

Re: PurePDF Version 2.0

Posted: Fri Sep 16, 2011 10:26 pm
by DoubleDutch
Thanks for fixing it so quickly. :)

Re: PurePDF Version 2.0

Posted: Fri Sep 16, 2011 10:33 pm
by DoubleDutch
Seems to work ok now.

Re: PurePDF Version 2.0

Posted: Sat Sep 17, 2011 12:35 am
by ABBKlaus
DoubleDutch wrote:Thanks for fixing it so quickly. :)
You are welcome.

Just uploaded another version that should fix pdf_Cell / pdf_MultiCell

- added ipf_EscapeU / ipf_Escape is now obsolete
- fixed pdf_Cell
- fixed pdf_MultiCell

ToDo :

- add the /Ascent /Descent /CapHeight /ItalicAngle /StemV /MissingWidth paramters in ipf_PutFonts (they are fixed for now)
- replace the ipf_Get_CharWidth api with the new font functions ipf_TTF_*

BR Klaus

Re: PurePDF Version 2.0

Posted: Thu Sep 22, 2011 12:29 pm
by ABBKlaus
update : PurePDF V2.21 with full unicode support

- fixed memory leak in ipf_LocalDecimal()
- updated ipf_Endian() procedures (Thanks to Rescator/skywalk/wilbert)
- updated ipf_GetStringWidth() is much faster now
- removed ipf_Get_CharWidth()
- added /Ascent /Descent /CapHeight /ItalicAngle /StemV /MissingWidth to unicode fonts
- fixed bug in ipf_EscapeU() when printing unicode strings like $010D where $0D has to be escaped
- removed the unicode parameter from pdf_SetFont() its now handled automatically when in unicode mode
- added unicode support to ipf_PutInfo()

http://www.purebasicpower.de/?download= ... B45X86.zip
http://www.purebasicpower.de/?download= ... B46X86.zip

BR Klaus

Re: PurePDF Version 2.0

Posted: Thu Sep 22, 2011 3:08 pm
by srod
Hi Klaus,

I didn't realise that you'd added support for Unicode fonts - awesome!

How complete is the support for Unicode? I mean, are we limited to PDF 'standard fonts', or can we embed any old font?

Re: PurePDF Version 2.0

Posted: Thu Sep 22, 2011 4:05 pm
by ABBKlaus
Hi Steven,

you can embed any Truetype font that has a cmap enty with format 4 encoding.

http://developer.apple.com/fonts/TTRefM ... 6cmap.html

[edit]You can check your fonts with this tool[/edit]

http://www.purebasicpower.de/downloads/ ... Checker.pb

Re: PurePDF Version 2.0

Posted: Fri Sep 23, 2011 3:35 pm
by srod
I take it the entire font gets embedded into our resulting pdf files rather than subsets of the font?

Great job Klaus.

Re: PurePDF Version 2.0

Posted: Fri Sep 23, 2011 4:25 pm
by ABBKlaus
srod wrote:I take it the entire font gets embedded into our resulting pdf files rather than subsets of the font?
Jep, it is based on the PHP-script DoubleDutch mentioned above. The font gets embedded plus a so called cidtogidmap (131072 Bytes) that maps unicode chars to glyphs.
This way you can encode all unicode characters.
I would advice you to use compression as show in Tutorial32 Unicode.pb
srod wrote:Great job Klaus.
You are welcome

BR Klaus

Re: PurePDF Version 2.0

Posted: Fri Oct 07, 2011 10:51 pm
by ABBKlaus