~ubuntu-branches/ubuntu/intrepid/fontconfig/intrepid

« back to all changes in this revision

Viewing changes to fc-glyphname/fc-glyphname.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 14:16:40 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071205141640-xikzw02c8gpgndze
Tags: 2.5.0-2ubuntu1
* Merge with Debian; remaining changes:
  - conf.d/40-nonlatin.conf: Add `MgOpen Moderna' to the list of fonts
    for which we might fall back to sans-serif.
  - conf.d/60-latin.conf: Prefer DejaVu over Bitstream Vera,
    as done for dapper.
  - 52-languageselector.conf loads language-selector.conf.
  - Include 52-languageselector.conf in the lists in conf.d/Makefile.am so
    that it actually gets installed and used.  Fixes LP 73714.
  - Some hackery in the debconf config script which attempts to upgrade
    user preferences across the many changes which have occurred to the
    debconf questions.  In particular:
    + Do not attempt to divine enable_bitmaps option by reading the
      symlinks in /etc.  This leaves the only way to permanently change
      the behaviour being dpkg-reconfigure.  The divination code was
      wrong and was intended by Debian to preserve pre-debconf
      configuration.  It would be nicer to preserve handmade updates to
      the /etc directory.
    + Always create /etc/fontconfig/conf.d/ symlink for enabling or
      disabling bitmap fonts.  This records the state from debconf
      unambiguously into the filesystem and will make it possible for
      future upgrades (from Edgy or later) to preserve handmade changes.
  - Add a (optional) include for "language-selector.conf" in fonts.conf
  - debian/patches/03_preferred_symbol_font.patch:
    + prefer "Standard Symbols L" as symbol font (Ubuntu: #37745)
  - Fix incorrect location of /usr/share/X11/fonts.
  - Correctly fix the (eg) firefox vs. (eg) evince font metrics problem:
    + New FC_ANY_METRICS property, boolean.
    + Change URW Nimbus and AMT font aliases in 30-{urw,metric}-aliases.conf
      into equivalent <match> directives so that we can add an additional
      test which disables them when the anymetrics property is true.
* Link using -Bsymbolic-functions.
* debian/rules (clean): Clean doc directory.
* debian/rules: Set shell to /bin/bash.

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
    i = (int) (h % hash);
207
207
    while (table[i])
208
208
    {
209
 
        if (!r) r = (int) (h % rehash);
 
209
        if (!r) r = (int) (h % rehash + 1);
210
210
        i += r;
211
211
        if (i >= hash)
212
212
            i -= hash;
217
217
static void
218
218
dump (FcGlyphName * const *table, const char *name)
219
219
{
220
 
    int i;
 
220
    int     i;
221
221
    
222
 
    printf ("static const FcGlyphName   *%s[%d] = {\n", name, hash);
 
222
    printf ("static const FcGlyphId %s[%d] = {\n", name, hash);
223
223
 
224
224
    for (i = 0; i < hash; i++)
225
225
        if (table[i])
226
 
            printf ("(FcGlyphName *) &glyph%d,\n", rawindex(table[i]));
 
226
            printf ("    %d,\n", rawindex(table[i]));
227
227
        else
228
 
            printf ("0,\n");
 
228
            printf ("    -1,\n");
229
229
    
230
230
    printf ("};\n");
231
231
}
237
237
    char        line[1024];
238
238
    FILE        *f;
239
239
    int         i;
 
240
    char        *type;
240
241
    
241
242
    i = 0;
242
243
    while (argv[i+1])
283
284
    printf ("#define FC_GLYPHNAME_HASH %u\n", hash);
284
285
    printf ("#define FC_GLYPHNAME_REHASH %u\n", rehash);
285
286
    printf ("#define FC_GLYPHNAME_MAXLEN %d\n\n", max_name_len);
 
287
    if (nraw < 128)
 
288
        type = "int8_t";
 
289
    else if (nraw < 32768)
 
290
        type = "int16_t";
 
291
    else
 
292
        type = "int32_t";
 
293
    
 
294
    printf ("typedef %s FcGlyphId;\n\n", type);
286
295
    
287
296
    /*
288
297
     * Dump out entries
289
298
     */
290
299
    
 
300
    printf ("static const struct { const FcChar32 ucs; const FcChar8 name[%d]; } glyphs[%d] = {\n",
 
301
            max_name_len + 1, nraw);
 
302
    
291
303
    for (i = 0; i < nraw; i++)
292
 
        printf ("static const struct { const FcChar32 ucs; const FcChar8 name[%d]; }"
293
 
                " glyph%d = { 0x%lx, \"%s\" };\n",
294
 
                (int) strlen ((char *) raw[i]->name) + 1,
295
 
                i, (unsigned long) raw[i]->ucs, raw[i]->name);
 
304
        printf ("    { 0x%lx, \"%s\" },\n",
 
305
                (unsigned long) raw[i]->ucs, raw[i]->name);
 
306
 
 
307
    printf ("};\n");
296
308
 
297
309
    /*
298
310
     * Dump out name_to_ucs table