1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 2 5 * of the License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software Foundation, 14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 * 16 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 17 * All rights reserved. 18 */ 19 20 #pragma once 21 22 /** \file 23 * \ingroup bli 24 * \brief A structure to represent vector fonts, 25 * and to load them from PostScript fonts. 26 */ 27 28 #include "DNA_listBase.h" 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 struct PackedFile; 35 struct VFont; 36 37 typedef struct VFontData { 38 struct GHash *characters; 39 char name[128]; 40 float scale; 41 /* Calculated from the font. */ 42 float em_height; 43 float ascender; 44 } VFontData; 45 46 typedef struct VChar { 47 ListBase nurbsbase; 48 unsigned int index; 49 float width; 50 } VChar; 51 52 VFontData *BLI_vfontdata_from_freetypefont(struct PackedFile *pf); 53 VFontData *BLI_vfontdata_copy(const VFontData *vfont_src, const int flag); 54 55 VChar *BLI_vfontchar_from_freetypefont(struct VFont *vfont, unsigned long character); 56 VChar *BLI_vfontchar_copy(const VChar *vchar_src, const int flag); 57 58 #ifdef __cplusplus 59 } 60 #endif 61