freetype
[Top][All Lists]
Advanced

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

[ft] Question about CPAL and FT_Palette_Data_Get (version 2.10.1)


From: Fábio Leandro
Subject: [ft] Question about CPAL and FT_Palette_Data_Get (version 2.10.1)
Date: Sun, 4 Aug 2019 11:41:41 +0100

Hello,

Let me begin by saying that this is my first post, so if there's something
wrong, feel free to let me know.

I'm trying to read FT_Palette_Data (using FT_Palette_Data_Get) but I'm
always getting nulls (and no errors):
num_palettes = 1
palette_name_ids = NULL
palette_flags = NULL
num_palette_entries = 2
palette_entry_name_ids = NULL

All i'm doing is:
if (FT_Set_Char_Size(face, 14 << 6, 14 << 6, 72, 72)) {
    return 3;
}

FT_Palette_Data palette;
if (FT_Palette_Data_Get(face, &palette)) {
    return 5;
}

Is there another function that I'm supposed to call before getting the
palette? (if so, I think it would be worthwhile to add a note in
FT_Palette_Data_Get docs)

Here's the cpal table as reported by ttx:
<CPAL>
  <version value="0"/>
  <numPaletteEntries value="2"/>
  <palette index="0">
    <color index="0" value="#C90900FF"/>
    <color index="1" value="#FF9580FF"/>
  </palette>
</CPAL>

As you can see, the counts match up.

You can find an example font attached (SIL licensed) but this happens with
any cpal font that I use.

(not sure if necessary, but better safe than sorry) font homepage:
https://djr.com/bungee/

Attachment: BungeeColor-Regular_colr_Windows.ttf
Description: font/ttf


reply via email to

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