]> www.fi.muni.cz Git - evince.git/blobdiff - backend/dvi/mdvi-lib/t1.c
Split API documentation into libdocument, libview and shell. Required
[evince.git] / backend / dvi / mdvi-lib / t1.c
index acbfa23eac7c45fd6019cd2b75166d22523d903b..4e7be63a6bc95ea3e2e4695ab580017681ee0298 100644 (file)
@@ -22,6 +22,7 @@
  * We use T1lib only as a rasterizer, not to draw glyphs.
  */
 
+#include <config.h>
 #include "mdvi.h"
 
 #ifdef WITH_TYPE1_FONTS
@@ -183,7 +184,7 @@ static void t1_reset_resolution(int xdpi, int ydpi)
                T1_DeleteAllSizes(i);
        /* reset device resolutions */
        if(T1_SetDeviceResolutions((float)xdpi, (float)ydpi) < 0)
-               warning(_("(t1) failed to reset device resolution\n"));
+               mdvi_warning(_("(t1) failed to reset device resolution\n"));
        else
                DEBUG((DBG_TYPE1, 
                        "(t1) reset successful, new resolution is (%d, %d)\n",
@@ -211,7 +212,7 @@ static void t1_transform_font(T1Info *info)
                        info->fontname, info->encoding->name));
                T1_DeleteAllSizes(info->t1id);
                if(T1_ReencodeFont(info->t1id, info->encoding->vector) < 0)
-                       warning(_("%s: could not encode font\n"), info->fontname);
+                       mdvi_warning(_("%s: could not encode font\n"), info->fontname);
        }
        if(info->mapinfo.slant) {
                DEBUG((DBG_TYPE1, "(t1) %s: slanting by %.3f\n", 
@@ -436,25 +437,16 @@ static int t1_load_font(DviParams *params, DviFont *font)
 
 static inline BITMAP *t1_glyph_bitmap(GLYPH *glyph)
 {
-       BITMAP  *bm;
-       int     w, h;
+       int     w, h, pad;
        
        w = GLYPH_WIDTH(glyph);
        h = GLYPH_HEIGHT(glyph);
 
        if(!w || !h)
                return MDVI_GLYPH_EMPTY;
-       switch(glyph->bpp << 3) {
-               case 8: 
-                       bm = bitmap_convert_lsb8((unsigned char *)glyph->bits, w, h);
-                       break;
-               default:
-                       warning(_("(t1) unsupported bitmap pad size %d\n"),
-                               glyph->bpp);
-                       bm = MDVI_GLYPH_EMPTY;
-                       break;
-       }
-       return bm;
+
+       pad = T1_GetBitmapPad();
+       return bitmap_convert_lsb8((unsigned char *)glyph->bits, w, h, ROUND(w, pad) * (pad >> 3));
 }
 
 static void t1_font_shrink_glyph(DviContext *dvi, DviFont *font, DviFontChar *ch, DviGlyph *dest)