[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] parthw-cleaned ee66387: [gf] Minor fixes.
From: |
Parth Wazurkar |
Subject: |
[freetype2] parthw-cleaned ee66387: [gf] Minor fixes. |
Date: |
Tue, 26 Jun 2018 19:42:43 -0400 (EDT) |
branch: parthw-cleaned
commit ee66387a0e8c17e8a998974216d912c7bfed5ffb
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>
[gf] Minor fixes.
---
modules.cfg | 2 +-
src/gf/gf.h | 1 +
src/gf/gfdrivr.c | 16 +++++++++-------
src/gf/gfdrivr.h | 33 +++++++++++++++++----------------
src/gf/rules.mk | 16 ++++++++--------
5 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/modules.cfg b/modules.cfg
index 79be2b9..3337e91 100644
--- a/modules.cfg
+++ b/modules.cfg
@@ -68,7 +68,7 @@ FONT_MODULES += pcf
FONT_MODULES += bdf
# GF font driver.
-#FONT_MODULES += gf
+FONT_MODULES += gf
# SFNT files support. If used without `truetype' or `cff', it supports
# bitmap-only fonts within an SFNT wrapper.
diff --git a/src/gf/gf.h b/src/gf/gf.h
index b88f730..e624b95 100644
--- a/src/gf/gf.h
+++ b/src/gf/gf.h
@@ -23,6 +23,7 @@
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_STREAM_H
+#include FT_SYSTEM_H
FT_BEGIN_HEADER
diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index a60948f..3723782 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -20,7 +20,8 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_OBJECTS_H
-
+#include FT_TRUETYPE_IDS_H
+#include FT_SERVICE_FONT_FORMAT_H
#include "gf.h"
#include "gfdrivr.h"
@@ -89,6 +90,7 @@
gf_cmap_char_next( FT_CMap gfcmap,
FT_UInt32 *achar_code )
{
+ GF_CMap cmap = (GF_CMap)gfcmap;
FT_UInt gindex = 0;
FT_UInt32 result = 0;
FT_UInt32 char_code = *achar_code + 1;
@@ -131,7 +133,7 @@
GF_Face_Done( FT_Face gfface ) /* GF_Face */
{
GF_Face face = (GF_Face)gfface;
- FT_Memory memory;
+ FT_Memory memory= FT_FACE_MEMORY( gfface );;
if ( !face )
@@ -139,7 +141,7 @@
memory = FT_FACE_MEMORY( face );
- gf_free_font( face->gf_glyph );
+ gf_free_font( face->gf_glyph, memory );
}
@@ -171,7 +173,7 @@
gfface->num_faces = 1;
gfface->face_index = 0;
- gfface->face_flags | = FT_FACE_FLAG_FIXED_SIZES |
FT_FACE_FLAG_HORIZONTAL ;
+ gfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
FT_FACE_FLAG_HORIZONTAL ;
gfface->family_name = NULL;
gfface->num_glyphs = (FT_Long)(go->code_max - go->code_min + 1 );
gfface->num_fixed_sizes = 1;
@@ -204,7 +206,7 @@
/* initial platform/encoding should indicate unset status? */
charmap.platform_id = TT_PLATFORM_APPLE_UNICODE; /*Preliminary */
charmap.encoding_id = TT_APPLE_ID_DEFAULT;
- charmap.face = root;
+ charmap.face = face;
error = FT_CMap_New( &gf_cmap_class, NULL, &charmap, NULL );
@@ -286,7 +288,7 @@
FT_Face face = FT_FACE( gf );
FT_Error error = FT_Err_Ok;
FT_Bitmap* bitmap = &slot->bitmap;
- GF_BitmapRec glyph ;
+ GF_BitmapRec bm ;
FT_UNUSED( load_flags );
@@ -316,7 +318,7 @@
glyph_index = 0;
/* slot, bitmap => freetype, glyph => gflib */
- glyph = gf->gf_glyph->bm_table[glyph_index];
+ bm = gf->gf_glyph->bm_table[glyph_index];
bitmap->rows = bm.mv_y ; /* Prelimiary */
bitmap->width = bm.mv_x ; /* Prelimiary */
diff --git a/src/gf/gfdrivr.h b/src/gf/gfdrivr.h
index 07a7564..f32b3b0 100644
--- a/src/gf/gfdrivr.h
+++ b/src/gf/gfdrivr.h
@@ -28,32 +28,33 @@
FT_BEGIN_HEADER
/* BitmapRec for GF format specific glyphs */
- typedef struct GF_BitmapRec_
+ typedef struct GF_BitmapRec_
{
- int bbx_width, bbx_height;
- int off_x, off_y;
- int mv_x, mv_y;
- unsigned char *bitmap;
- int raster;
+ FT_UInt bbx_width, bbx_height;
+ FT_UInt off_x, off_y;
+ FT_UInt mv_x, mv_y;
+ FT_Byte *bitmap;
+ FT_UInt raster;
+
} GF_BitmapRec, *GF_Bitmap;
-
- typedef struct GF_Glyph_
+
+ typedef struct GF_GlyphRec_
{
- int code_min, code_max;
- GF_BITMAP bm_table;
- double ds, hppp, vppp;
- int font_bbx_w, font_bbx_h;
- int font_bbx_xoff, font_bbx_yoff;
- } GF_Glyph, *GF_Glyph;
+ FT_UInt code_min, code_max;
+ GF_Bitmap bm_table;
+ double ds, hppp, vppp;
+ FT_UInt font_bbx_w, font_bbx_h;
+ FT_UInt font_bbx_xoff, font_bbx_yoff;
+
+ } GF_GlyphRec, *GF_Glyph;
typedef struct GF_FaceRec_
{
FT_FaceRec root;
GF_Glyph gf_glyph;
- GF_BitmapRec gf_bitmap;
-
+
} GF_FaceRec, *GF_Face;
diff --git a/src/gf/rules.mk b/src/gf/rules.mk
index 4f13803..a261541 100644
--- a/src/gf/rules.mk
+++ b/src/gf/rules.mk
@@ -26,27 +26,27 @@ GF_COMPILE := $(CC) $(ANSIFLAGS)
\
# gf driver sources (i.e., C files)
#
-BDF_DRV_SRC := $(BDF_DIR)/gflib.c \
- $(BDF_DIR)/gfdrivr.c
+GF_DRV_SRC := $(GF_DIR)/gflib.c \
+ $(GF_DIR)/gfdrivr.c
# gf driver headers
#
-GF_DRV_H := $(BDF_DIR)/gf.h \
- $(BDF_DIR)/gfdrivr.h \
- $(BDF_DIR)/gferror.h
+GF_DRV_H := $(GF_DIR)/gf.h \
+ $(GF_DIR)/gfdrivr.h \
+ $(GF_DIR)/gferror.h
# gf driver object(s)
#
# GF_DRV_OBJ_M is used during `multi' builds
# GF_DRV_OBJ_S is used during `single' builds
#
-GF_DRV_OBJ_M := $(GF_DRV_SRC:$(BDF_DIR)/%.c=$(OBJ_DIR)/%.$O)
+GF_DRV_OBJ_M := $(GF_DRV_SRC:$(GF_DIR)/%.c=$(OBJ_DIR)/%.$O)
GF_DRV_OBJ_S := $(OBJ_DIR)/gf.$O
# gf driver source file for single build
#
-GF_DRV_SRC_S := $(BDF_DIR)/gf.c
+GF_DRV_SRC_S := $(GF_DIR)/gf.c
# gf driver - single object
@@ -57,7 +57,7 @@ $(GF_DRV_OBJ_S): $(GF_DRV_SRC_S) $(GF_DRV_SRC) $(FREETYPE_H)
$(GF_DRV_H)
# gf driver - multiple objects
#
-$(OBJ_DIR)/%.$O: $(GF_DIR)/%.c $(FREETYPE_H) $(BDF_DRV_H)
+$(OBJ_DIR)/%.$O: $(GF_DIR)/%.c $(FREETYPE_H) $(GF_DRV_H)
$(GF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] parthw-cleaned ee66387: [gf] Minor fixes.,
Parth Wazurkar <=