2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
|
2002-11-25 11:16:17 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
2021-10-06 10:44:11 +11:00
|
|
|
* \ingroup bke
|
2019-02-18 08:08:12 +11:00
|
|
|
* \brief A structure to represent vector fonts,
|
2011-02-18 13:58:08 +00:00
|
|
|
* and to load them from PostScript fonts.
|
|
|
|
|
*/
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_listBase.h"
|
|
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
struct PackedFile;
|
2005-09-14 14:02:21 +00:00
|
|
|
struct VFont;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
typedef struct VFontData {
|
2013-12-28 17:33:19 +11:00
|
|
|
struct GHash *characters;
|
2012-05-12 20:39:39 +00:00
|
|
|
char name[128];
|
2013-12-28 19:45:54 +11:00
|
|
|
float scale;
|
2018-09-05 11:21:12 +10:00
|
|
|
/* Calculated from the font. */
|
|
|
|
|
float em_height;
|
|
|
|
|
float ascender;
|
2002-10-12 11:37:38 +00:00
|
|
|
} VFontData;
|
|
|
|
|
|
2005-09-14 14:02:21 +00:00
|
|
|
typedef struct VChar {
|
2012-05-12 20:39:39 +00:00
|
|
|
ListBase nurbsbase;
|
2013-12-28 17:33:19 +11:00
|
|
|
unsigned int index;
|
2012-05-12 20:39:39 +00:00
|
|
|
float width;
|
2005-09-14 14:02:21 +00:00
|
|
|
} VChar;
|
|
|
|
|
|
2021-12-07 17:19:15 +11:00
|
|
|
/**
|
|
|
|
|
* Construct a new #VFontData structure from free-type font data in `pf`.
|
|
|
|
|
*
|
|
|
|
|
* \param pf: The font data.
|
|
|
|
|
* \retval A new #VFontData structure, or NULL if unable to load.
|
|
|
|
|
*/
|
2021-10-06 10:44:11 +11:00
|
|
|
VFontData *BKE_vfontdata_from_freetypefont(struct PackedFile *pf);
|
2022-01-07 11:38:08 +11:00
|
|
|
VFontData *BKE_vfontdata_copy(const VFontData *vfont_src, int flag);
|
2005-09-14 14:02:21 +00:00
|
|
|
|
2021-10-06 10:44:11 +11:00
|
|
|
VChar *BKE_vfontdata_char_from_freetypefont(struct VFont *vfont, unsigned long character);
|
2021-10-06 10:54:30 +11:00
|
|
|
VChar *BKE_vfontdata_char_copy(const VChar *vchar_src);
|
2005-09-14 14:02:21 +00:00
|
|
|
|
2020-03-02 15:04:53 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|