Re: Libharu D binding harud unicode support

2017-03-02 Thread Kagamin via Digitalmars-d-learn
It looks like libharu or pdf don't support unicode well, see 
http://libharu.org/ so you probably need to select the turkish 
codepage and supply text in that encoding.


Libharu D binding harud unicode support

2017-03-01 Thread Erdem via Digitalmars-d-learn
How should one use libharu d binding in unicode mode. Consider 
this basic example.


import std.stdio;

import harud;
import harud.c;

void main()
{
   void  errorCallback(uint error_number, uint detail_number)
   {
  writefln("err %x, %s, (num %x)"
, error_number
, getErrorDescription(error_number),
detail_number);
   }

   Doc pdf = new Doc();   ///  New pdf document
   Font helvetica = pdf.getFont("Helvetica");
   writeln("build font");

   Page page = pdf.addPage(); /// Add a new page to the document

   writeln("page width:", page.width);

   auto status = page.setFontAndSize(helvetica, 60);   /// Set 
the current font and size for the page

   writeln("set font width:", 60, " status", status);

   status = page.beginText(); /// Begin text mode
   writeln("begin ", status);

   status = page.showText("üçÇÜÖöĞğIı"); /// Print text to the 
page

   writeln("show ", status);

   page.endText(); /// End text mode

   pdf.saveToFile("./hello.pdf"); /// Write to disk
}

As you'd see I'd like to be able to write some Turkish characters 
to pdf file using libharu D binding.(a.k.a. harud)