Exemplo n.º 1
0
USHORT __pascal VIOQUERYFONTS(PLONG plRemfonts,
                              PFONTMETRICS afmMetrics,
                              LONG lMetricsLength,
                              PLONG plFonts,
                              PSZ pszFacename,
                              ULONG flOptions,
                              HVPS hvps)
{
  return VioQueryFonts(plRemfonts, afmMetrics, lMetricsLength,
                       plFonts, pszFacename, flOptions, hvps);
}
Exemplo n.º 2
0
int fly_get_fontlist (flyfont **F, int restrict_by_language)
{
    ULONG             remfonts, nf, nff;
    FONTMETRICS       *fm;
    int               rc, i;
    char              buffer[64];

    // find how many fonts are available
    nf = 0;
    VioQueryFonts (&remfonts, NULL, sizeof(FONTMETRICS), &nf, NULL, VQF_PUBLIC, hvps);
    nf = remfonts;
    // retrieve information about them
    fm = malloc (sizeof (FONTMETRICS) * nf);
    *F = malloc (sizeof (flyfont) * nf);
    memset (fm, 0, sizeof (fm));
    rc = VioQueryFonts (&remfonts, fm, sizeof(FONTMETRICS), &nf, NULL, VQF_PUBLIC, hvps);
    // filter out what we need
    nff = 0;
    for (i=0; i<nf; i++)
    {
        if (strcmp (fm[i].szFamilyname, "System VIO")) continue;
        //if (!(fm[i].fsType & FM_TYPE_FIXED)) continue;
        
        debug_tools ("Font # %d\nfamily: %s, face: %s, width = %d, height = %d\n",
                     i, fm[i].szFamilyname, fm[i].szFacename, fm[i].lAveCharWidth, fm[i].lMaxBaselineExt);
        
        (*F)[nff].cx = fm[i].lAveCharWidth;
        (*F)[nff].cy = fm[i].lMaxBaselineExt;
        snprintf1 (buffer, sizeof(buffer), "%s %ldx%ld", fm[i].szFacename, fm[i].lAveCharWidth, fm[i].lMaxBaselineExt);
        (*F)[nff].name = strdup (buffer);
        (*F)[nff].signature = (void *)fm[i].lMatch;
        nff++;
    }

    free (fm);
    return nff;
}