]> www.fi.muni.cz Git - evince.git/blobdiff - dvi/mdvi-lib/t1.c
Added Romanian translation by Misu Moldovan.
[evince.git] / dvi / mdvi-lib / t1.c
index bc2900b2049e6ce05126d3f48e3cebf43f056537..acbfa23eac7c45fd6019cd2b75166d22523d903b 100644 (file)
@@ -123,7 +123,7 @@ char        *t1_lookup_font(const char *name, Ushort *hdpi, Ushort *vdpi)
                DEBUG((DBG_TYPE1, "(t1) %s: found `%s' (cached)\n",
                        name, info.fullfile));
                /* this is a cached lookup */
-               return xstrdup(info.fullfile);
+               return mdvi_strdup(info.fullfile);
        }
        
        /* no file associated to this font? */
@@ -142,7 +142,7 @@ char        *t1_lookup_font(const char *name, Ushort *hdpi, Ushort *vdpi)
 
        /* get the `base' name */
        if(ext) {
-               newname = xstrdup(name);
+               newname = mdvi_strdup(name);
                newname[ext - info.fontfile - 1] = 0;
        } else
                newname = (char *)name; /* we don't modify this */
@@ -154,7 +154,7 @@ char        *t1_lookup_font(const char *name, Ushort *hdpi, Ushort *vdpi)
 
        /* we don't need this anymore */
        if(newname != name)
-               xfree(newname);
+               mdvi_free(newname);
        if(filename == NULL) {
                DEBUG((DBG_TYPE1, "(t1) %s: not found\n", name));
                return NULL;
@@ -173,8 +173,12 @@ static void t1_reset_resolution(int xdpi, int ydpi)
 
        DEBUG((DBG_TYPE1, "(t1) resetting device resolution (current: (%d,%d))\n",
                t1lib_xdpi, t1lib_ydpi));
-
+#if T1LIB_VERSION < 5
        nfonts = T1_Get_no_fonts();
+#else
+       nfonts = T1_GetNoFonts();
+#endif 
+
        for(i = 0; i < nfonts; i++)
                T1_DeleteAllSizes(i);
        /* reset device resolutions */
@@ -261,7 +265,7 @@ static int t1_really_load_font(DviParams *params, DviFont *font, T1Info *info)
        font->design = info->tfminfo->design;
 
        /* check if we have a font with this name (maybe at a different size) */
-       old = (T1Info *)mdvi_hash_lookup(&t1hash, info->fontname);
+       old = (T1Info *)mdvi_hash_lookup(&t1hash, (unsigned char *)info->fontname);
        if(old == info) {
                /* let's avoid confusion */
                old = NULL;
@@ -290,8 +294,8 @@ static int t1_really_load_font(DviParams *params, DviFont *font, T1Info *info)
        if(old && old->t1id == -1) {
                DEBUG((DBG_TYPE1, "(t1) font `%s' exchanged in hash table\n",
                        info->fontname));
-               mdvi_hash_remove(&t1hash, old->fontname);
-               mdvi_hash_add(&t1hash, info->fontname, 
+               mdvi_hash_remove(&t1hash, (unsigned char *)old->fontname);
+               mdvi_hash_add(&t1hash, (unsigned char *)info->fontname, 
                        info, MDVI_HASH_UNCHECKED);
        }
 
@@ -312,7 +316,7 @@ static int t1_really_load_font(DviParams *params, DviFont *font, T1Info *info)
        i = info->tfminfo->hic - info->tfminfo->loc + 1;
        if(i != font->hic - font->loc + 1) {
                /* reset to optimal size */
-               font->chars = xrealloc(font->chars, i * sizeof(DviFontChar));
+               font->chars = mdvi_realloc(font->chars, i * sizeof(DviFontChar));
        }
 
        /* get the scaled characters metrics */
@@ -330,7 +334,7 @@ t1_error:
        /* first destroy the private data */
        t1_font_remove(info);
        /* now reset all chars -- this is the important part */
-       xfree(font->chars);
+       mdvi_free(font->chars);
        font->chars = NULL;
        font->loc = font->hic = 0;
        return -1;
@@ -404,7 +408,7 @@ static int t1_load_font(DviParams *params, DviFont *font)
        /* create the hash table if we have not done so yet */
        if(t1hash.nbucks == 0)
                mdvi_hash_create(&t1hash, T1_HASH_SIZE);
-       mdvi_hash_add(&t1hash, info->fontname, info, MDVI_HASH_UNIQUE);         
+       mdvi_hash_add(&t1hash, (unsigned char *) info->fontname, info, MDVI_HASH_UNIQUE);               
        listh_append(&t1fonts, LIST(info));
 
        font->private = info;
@@ -442,7 +446,7 @@ static inline BITMAP *t1_glyph_bitmap(GLYPH *glyph)
                return MDVI_GLYPH_EMPTY;
        switch(glyph->bpp << 3) {
                case 8: 
-                       bm = bitmap_convert_lsb8(glyph->bits, w, h);
+                       bm = bitmap_convert_lsb8((unsigned char *)glyph->bits, w, h);
                        break;
                default:
                        warning(_("(t1) unsupported bitmap pad size %d\n"),
@@ -568,16 +572,16 @@ static void t1_font_remove(T1Info *info)
        listh_remove(&t1fonts, LIST(info));
 
        /* it it's in the hash table, we may need to replace this by another font */
-       old = (T1Info *)mdvi_hash_lookup(&t1hash, info->fontname);
+       old = (T1Info *)mdvi_hash_lookup(&t1hash, (unsigned char *)info->fontname);
        if(old == info) {
-               mdvi_hash_remove(&t1hash, info->fontname);
+               mdvi_hash_remove(&t1hash, (unsigned char *) info->fontname);
                /* go through the list and see if there is another 
                 * font with this name */
                for(old = (T1Info *)t1fonts.head; old; old = old->next)
                        if(STREQ(old->fontname, info->fontname))
                                break;
                if(old != NULL)
-                       mdvi_hash_add(&t1hash, old->fontname, old, 
+                       mdvi_hash_add(&t1hash, (unsigned char *) old->fontname, old, 
                                MDVI_HASH_UNCHECKED);
        }
        /* release our encoding vector */
@@ -598,8 +602,8 @@ static void t1_font_remove(T1Info *info)
 
        if(info->tfminfo)
                free_font_metrics(info->tfminfo);
-       /*xfree(info->fontname);*/
-       xfree(info);
+       /*mdvi_free(info->fontname);*/
+       mdvi_free(info);
 }
 
 static void t1_free_data(DviFont *font)