2023-05-31 16:19:06 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2002-11-25 12:16:17 +01:00
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
2021-10-06 01:44:11 +02:00
|
|
|
* \ingroup bke
|
2019-02-17 22:08:12 +01:00
|
|
|
* \brief A structure to represent vector fonts,
|
2011-02-18 14:58:08 +01:00
|
|
|
* and to load them from PostScript fonts.
|
|
|
|
*/
|
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
#include "DNA_listBase.h"
|
|
|
|
|
2023-11-28 22:13:09 +01:00
|
|
|
struct GHash;
|
2002-10-12 13:37:38 +02:00
|
|
|
struct PackedFile;
|
2005-09-14 16:02:21 +02:00
|
|
|
struct VFont;
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-11-28 22:13:09 +01:00
|
|
|
struct VFontData {
|
|
|
|
GHash *characters;
|
2012-05-12 22:39:39 +02:00
|
|
|
char name[128];
|
2013-12-28 09:45:54 +01:00
|
|
|
float scale;
|
2018-09-05 03:21:12 +02:00
|
|
|
/* Calculated from the font. */
|
|
|
|
float em_height;
|
|
|
|
float ascender;
|
2023-11-28 22:13:09 +01:00
|
|
|
};
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2023-11-28 22:13:09 +01:00
|
|
|
struct VChar {
|
2012-05-12 22:39:39 +02:00
|
|
|
ListBase nurbsbase;
|
2013-12-28 07:33:19 +01:00
|
|
|
unsigned int index;
|
2012-05-12 22:39:39 +02:00
|
|
|
float width;
|
2023-11-28 22:13:09 +01:00
|
|
|
};
|
2005-09-14 16:02:21 +02:00
|
|
|
|
2021-12-07 07:19:15 +01: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.
|
|
|
|
*/
|
2023-11-28 22:13:09 +01:00
|
|
|
VFontData *BKE_vfontdata_from_freetypefont(PackedFile *pf);
|
2022-01-07 01:38:08 +01:00
|
|
|
VFontData *BKE_vfontdata_copy(const VFontData *vfont_src, int flag);
|
2005-09-14 16:02:21 +02:00
|
|
|
|
2023-11-28 22:13:09 +01:00
|
|
|
VChar *BKE_vfontdata_char_from_freetypefont(VFont *vfont, unsigned long character);
|
2021-10-06 01:54:30 +02:00
|
|
|
VChar *BKE_vfontdata_char_copy(const VChar *vchar_src);
|