I'm trying to figure out a way to render certain unicode characters as a custom character instead of how they are supposed to appear.
For example, I would like the character U+0E4A to render as something else rather than how it currently appears in Windows.
I tried to create a quick custom font and to replace those glyphs but it only seems to work in some programs. My font will work correctly in LibreOffice Writer but it won't display properly in WordPad. Replacing regular letters works fine, but for other unicode characters they seem to revert back to a default way of rendering and don't display correctly.
Here is a screenshot of my custom font in WordPad, as you can see I made an obvious edit to the B character but I also did the same to the U+0E4A code point and yet it renders as normal.
If there is a special font that already does this that would probably save me the time of making a custom font, but either way I can't figure out how to render these characters as a custom character.
I was reading about barcodes, just a general query I came up with:
Does the length of barcode image change because of the text in it?
For eg: will the length of a barcode with 986262 be different than 111111?
Generally speaking, you can consider barcodes "monospaced". The only cases for which this isn't true are when a character needs an escape code to be represented.
For example in Code 128B, you need to escape to Code 128A to issue a control character like TAB, or in Code 128A you need to switch temporarily to Code 128B to embed a lowercase alphabetical character.
I am using PDFLib 7 to generate mailing labels. I am having issues displaying French accented characters. For example, Maître Corbeau is displayed as Maître Corbeau. Similarly, SadÖ is displayed as SADÃ.
The simplified code that I am using is like this:
$pdfDoc = new PDFlib();
$pdfDoc->set_info("Creator", "Kits Communications");
// more document info settings
$pdfDoc->begin_page_ext($PageWidth, $PageHeight, "");
$font = $pdfDoc->load_font("Helvetica", "auto", "");
$pdfDoc->setfont($font, 9.0);
// get data in variables
$pdfDoc->show(strtoupper($NameLine1));
$pdfDoc->continue_text($AddressLine1);
If I display the contents on the page with echo, the string is displayed correctly. I believe that perhaps I need to define default character set to PDFLib. Could someone please advise the required command to be used for PDFLib 7?
The text I was writing into a PDFLib document is in UTF-8 format. If I send the text in ANSI format, the mailing labels appear correctly. I added the following command to convert text to the ANSI format.
$NameLine1 = iconv("UTF-8", "Windows-1252",$NameLine1);
This fixed the issue on Windows PC. Not tested on Mac.
I print a text using ZPL but they are printed incorrectly. It has gaps in the middle. They are printed correctly to the real printer via the ZebraDesigner. But they are wrong when printing via ZPL:
^FT246,70^A0R,16,16
^FB900,2,,
^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
It is printed as 'Maisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi, Sojasprossen'
(there is a big gap after 'Mais,').
http://screencast.com/t/sTiaxC3cMg
http://screencast.com/t/0QkypnsPyF89
Please help.
Thanks
I'm unable to reproduce the issue, but the field block width seems rather large; you didn't specify any label dimensions in the original post. If you use the following code--a combination from the original post and your comments:
^XA
^PW560
^LL560
^LS0
^FO246,70^GB28,300,,^FS
^FT246,70^A0R,16,16 ^FB300,2,, ^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
^PQ1,0,1,Y
^XZ
I can reproduce what is possibly the issue--the field block automatic word wrapping--by reducing the field block width to 300 dots.
I also drew a box around the block for visualization. You can test in on the Labelary Viewer.
Finally, if you're somehow composing the data make sure there are no special (non printable, such as tab, non-UTF-8 or accented) characters in it, and if so, you will have to pre-escape them.
I am able to display chinese character correctly but when I try to display arabic string the output that display in OpenGL scene is different from the arabic string that display in Visual Studio Editor. I know it should be something to do with "Complex Script" but I am not able to find any good example regarding to this matter. I would like to know how to display arabic text correctly?
Unlike Latin characters which each have a single visual representation, each Arabic character can have many different appearances depending on the surrounding characters. The logical characters in an Arabic string need to be converted to a sequence of visual glyphs in order to be correctly displayed. OpenGL doesn't do this processing for you so you're seeing the logical characters rendered without this processing.
To get around this you will need to use a library such as Uniscribe to transform the logical string into a visual string which you then give to OpenGL for rendering. There are some samples here.