*length = 0;
FT_ULong tag = FT_MAKE_TAG (tag_str[0], tag_str[1], tag_str[2], tag_str[3]);
- int error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
+ FT_Error error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
if (!error_code)
{
FT_Byte *buffer = (FT_Byte *) malloc (*length);
open_ft_face (string str, FT_Long idx)
{
FT_Face face;
- int error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face);
+ FT_Error error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face);
if (error_code == FT_Err_Unknown_File_Format)
error (_f ("unsupported font format: %s", str.c_str ()));
{
const size_t len = 256;
char name[len];
- size_t code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
+ FT_Error code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
if (code)
warning (_f ("FT_Get_Glyph_Name () Freetype error: %s",
freetype_error_string (code)));
size_t
Open_type_font::index_to_charcode (size_t i) const
{
- return index_to_charcode_map_.at(i);
+ map<FT_UInt, FT_ULong>::const_iterator iter;
+ iter = index_to_charcode_map_.find (i);
+
+ if (iter != index_to_charcode_map_.end ())
+ return (size_t) iter->second;
+ else
+ {
+ programming_error (_ ("Invalid index for character"));
+ return 0;
+ }
}
size_t
return FT_Get_Postscript_Name (face_);
}
-
SCM
Open_type_font::glyph_list () const
{
{
const size_t len = 256;
char name[len];
- size_t code = FT_Get_Glyph_Name (face_, i, name, len);
+ FT_Error code = FT_Get_Glyph_Name (face_, i, name, len);
if (code)
warning (_f ("FT_Get_Glyph_Name () error: %s",
freetype_error_string (code).c_str ()));