2022-08-27 08:53:03 +00:00
|
|
|
/*
|
2022-12-07 06:11:08 +00:00
|
|
|
font.h
|
2022-08-27 08:53:03 +00:00
|
|
|
|
2022-12-07 06:11:08 +00:00
|
|
|
Font management
|
2022-08-27 08:53:03 +00:00
|
|
|
|
|
|
|
Copyright (C) 2022 Bill Currie <bill@taniwha.org>
|
|
|
|
|
|
|
|
Author: Bill Currie <bill@taniwha.org>
|
|
|
|
Date: 2022/8/26
|
|
|
|
|
|
|
|
This program 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 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program 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 this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2022-12-07 06:11:08 +00:00
|
|
|
#ifndef __QF_ui_font_h
|
|
|
|
#define __QF_ui_font_h
|
2022-08-27 08:53:03 +00:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
|
|
|
#include "QF/ui/vrect.h"
|
|
|
|
#include "QF/simd/types.h"
|
|
|
|
|
|
|
|
#include "r_scrap.h"
|
|
|
|
|
2022-10-31 15:40:52 +00:00
|
|
|
typedef struct fontent_s {
|
|
|
|
uint32_t id;
|
|
|
|
} fontent_t;
|
2022-08-27 08:53:03 +00:00
|
|
|
|
2022-12-07 06:11:08 +00:00
|
|
|
typedef struct font_s {
|
2022-08-27 08:53:03 +00:00
|
|
|
void *font_resource;
|
|
|
|
FT_Face face;
|
|
|
|
rscrap_t scrap;
|
|
|
|
byte *scrap_bitmap;
|
2022-09-04 11:56:38 +00:00
|
|
|
FT_Long num_glyphs;
|
2022-10-20 06:50:53 +00:00
|
|
|
vrect_t *glyph_rects;
|
|
|
|
vec2i_t *glyph_bearings;
|
2022-12-08 07:57:45 +00:00
|
|
|
uint32_t fontid;
|
2022-12-07 06:11:08 +00:00
|
|
|
} font_t;
|
2022-08-27 08:53:03 +00:00
|
|
|
|
2022-12-07 06:11:08 +00:00
|
|
|
void Font_Init (void);
|
|
|
|
void Font_Free (font_t *font);
|
|
|
|
font_t *Font_Load (QFile *font_file, int size);
|
2022-08-27 08:53:03 +00:00
|
|
|
|
2022-12-07 06:11:08 +00:00
|
|
|
#endif//__QF_ui_font_h
|