freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] How to map a char to glyph with pcf


From: Werner LEMBERG
Subject: Re: [ft-devel] How to map a char to glyph with pcf
Date: Fri, 23 Mar 2018 07:04:26 +0100 (CET)

> I was sorry I didn't explain my problem clearly.  I want to know if
> freetype2 have Done this mapping(step [3]) in the library?  Or I
> have to write extra code for support it?[link 1]

> [1] char buf[2]="\xb4\xeb";

[I assume that you are only interested in 16bit values representing
Korean Hangul and Hanja.]

> [2] buf &= 0x7F;

It's rather

  buf[0] &= 0x7F;
  buf[1] &= 0x7F;

Using ISO 2022 speak, this converts EUC-KR's character set in the G1
slot from GR representation (0xA1-0xFE × 0xA1-0xFE) to GL (0x21-0x7E ×
0x21-0x7E).

> buf -= 0x20;

This is wrong.  Remove it.  As you can check with 'ftdump -V', the
cmap in your PCF font starts with

  0x2121 => 2356
  0x2122 => 2357
  0x2123 => 2358
  0x2124 => 2359
  ....

> [3] buf --> Glyph Index

Yes.  In FreeType, after selecting the character map, you can now use
`FT_Load_Char' to map a (16bit) code value in `buf' to a glyph index.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]