freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] ftdump functionality in ftinstpect


From: Werner LEMBERG
Subject: Re: [ft-devel] ftdump functionality in ftinstpect
Date: Sat, 27 Oct 2018 10:01:07 +0200 (CEST)

[Ankit, please always reply to the list.]


Thanks for the first draft of a patch!

> > The meaning of the EID values depending on PID are given in
> >
> >   https://docs.microsoft.com/en-us/typography/opentype/spec/cmap
> >   https://docs.microsoft.com/en-us/typography/opentype/spec/name
>
> These references doesn't contain information about the encoding and
> language id corresponding to platform id=7 (Adobe).  I tried looking
> for them but I was unable to find them.  If you can provide a hint
> where to look, will be greatly helpful.

Hmm.  Have you checked FreeType's documentation text for
TT_PLATFORM_ADOBE?

  *   TT_PLATFORM_ADOBE ::
  *     This value isn't part of any font format specification, but is
  *     used by FreeType to report Adobe-specific charmaps in an
  *     @FT_CharMapRec structure.  See @TT_ADOBE_ID_XXX.

This leads to 

  /**************************************************************************
   *
   * @enum:
   *   TT_ADOBE_ID_XXX
   *
   * @description:
   *   A list of valid values for the `encoding_id` for @TT_PLATFORM_ADOBE
   *   charmaps.  This is a FreeType-specific extension!
   *
   * @values:
   *   TT_ADOBE_ID_STANDARD ::
   *     Adobe standard encoding.
   *   TT_ADOBE_ID_EXPERT ::
   *     Adobe expert encoding.
   *   TT_ADOBE_ID_CUSTOM ::
   *     Adobe custom encoding.
   *   TT_ADOBE_ID_LATIN_1 ::
   *     Adobe Latin~1 encoding.
   */

> Should I convert Language ID in text too.

Ideally yes, but this is a lot of work...  If you do that, please
compare the data with the stuff Behdad has collected for HarfBuzz,
e.g.,

  https://github.com/harfbuzz/harfbuzz/blob/master/src/hb-ot-name-language.cc

to stay in sync.

> If yes, should I add in same file or create another .c file for this
> and import function?

A separate file with all the static tables would be good, yes.


Two comments regarding your code.

> +  case TT_PLATFORM_APPLE_UNICODE:
> +    switch( eid )
> +    {
> +    case 0:
> ...

I think it would be easier to read and edit the source code if you
rather do something like

  static const char  eid_apple_unicode[] = {
    "foo",
    "bar",
    ...
  };

to avoid large switch statements.  As discussed above, this would also
easily allow a separate file for the static data.

> +   printf( "\tformat: %2ld \n\tPlatform: %s\n\tEncoding: %s\n",

Please replace `\t' with spaces.


    Werner



reply via email to

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