X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fopen-type-font.hh;h=76d015325591ab602900aa356146fb0cf4d8431c;hb=2fef7b7eb7ac5d7a2ed237bf22a6ec6fe5d946d9;hp=e75b4c62d4280efac1b1658d32f488cdf469aa9a;hpb=4ecdbd7d70ca7441be4dddd15ac01cc255bc2a35;p=lilypond.git diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index e75b4c62d4..76d0153255 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -1,57 +1,74 @@ /* - open-type-font.hh -- declare Open_type_font + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2004--2015 Han-Wen Nienhuys - (c) 2004--2005 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef OPEN_TYPE_FONT_HH #define OPEN_TYPE_FONT_HH -#include -using namespace std; - -#include "freetype.hh" #include "font-metric.hh" -typedef map Index_to_charcode_map; Index_to_charcode_map make_index_to_charcode_map (FT_Face face); +void get_unicode_name (char *s, FT_ULong code); +void get_glyph_index_name (char *s, FT_ULong code); -class Open_type_font : public Font_metric -{ - /* handle to face object */ - FT_Face face_; - +struct Preinit_Open_type_font { SCM lily_subfonts_; SCM lily_character_table_; SCM lily_global_table_; SCM lily_index_to_bbox_table_; + Preinit_Open_type_font (); +}; + +class Open_type_font : Preinit_Open_type_font, public Font_metric +{ + /* handle to face object */ + FT_Face face_; + string postscript_name_; Index_to_charcode_map index_to_charcode_map_; Open_type_font (FT_Face); + DECLARE_CLASSNAME (Open_type_font); public: + Real get_units_per_EM () const; SCM get_subfonts () const; SCM get_global_table () const; SCM get_char_table () const; - - String get_otf_table (String tag) const; - static SCM make_otf (String); - virtual String font_name () const; - virtual ~Open_type_font (); - virtual Offset attachment_point (String) const; - virtual int count () const; - virtual Box get_indexed_char (int) const; - virtual int name_to_index (String) const; - //virtual unsigned glyph_name_to_charcode (String) const; - virtual unsigned index_to_charcode (int) const; - virtual void derived_mark () const; - virtual SCM sub_fonts () const; - virtual Real design_size () const; + SCM glyph_list () const; + SCM get_glyph_outline (size_t signed_idx) const; + Box get_glyph_outline_bbox (size_t signed_idx) const; + string get_otf_table (const string &tag) const; + static SCM make_otf (const string&); + string font_name () const; + ~Open_type_font (); + Offset attachment_point (const string&) const; + size_t count () const; + Box get_indexed_char_dimensions (size_t) const; + Box get_unscaled_indexed_char_dimensions (size_t) const; + size_t name_to_index (string) const; + size_t index_to_charcode (size_t) const; + void derived_mark () const; + SCM sub_fonts () const; + Real design_size () const; }; -String get_otf_table (FT_Face face, String tag); -FT_Face open_ft_face (String str); +string get_otf_table (FT_Face face, const string &tag); +FT_Face open_ft_face (const string&, FT_Long idx); +string get_postscript_name (FT_Face face); #endif /* OPEN_TYPE_FONT_HH */