view libass/ass_cache.h @ 19877:f16afec4c9c0

Fix missleading msg printed when subcp_open is given NULL as parameter (like as demux_ogg and demux_mkv do) Patch by: Zuxy Meng %zuxy.meng A gmail P com% Original Thread: Message-ID: <a18e06b40609160400l74263121p5f41eaf3549caf5@mail.gmail.com> Date: Sat, 16 Sep 2006 19:00:57 +0800 To: mplayer-dev-eng@mplayerhq.hu Subject: [MPlayer-dev-eng] [PATCH] Remove erroneaus warning message in subreader.c
author gpoirier
date Mon, 18 Sep 2006 11:47:41 +0000
parents 07be98a5dd5f
children 70352570e9ae
line wrap: on
line source

#ifndef __ASS_CACHE_H__
#define __ASS_CACHE_H__

#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_STROKER_H
#include FT_GLYPH_H

// font cache
typedef struct face_desc_s {
	char* family;
	unsigned bold;
	unsigned italic;
} face_desc_t;

void ass_face_cache_init(void);
int ass_new_face(FT_Library library, void* fontconfig_priv, face_desc_t* desc, /*out*/ FT_Face* face);
void ass_face_cache_done(void);


// describes a glyph; glyphs with equivalents structs are considered identical
typedef struct glyph_hash_key_s {
	char bitmap; // bool : true = bitmap, false = outline
	FT_Face face;
	int size; // font size
	int index; // glyph index in the face
	unsigned outline; // border width, 16.16 fixed point value
	int bold, italic;
	char be; // blur edges

	// the following affects bitmap glyphs only
	unsigned scale_x, scale_y; // 16.16
	int angle; // signed 16.16
	
	FT_Vector advance; // subpixel shift vector
} glyph_hash_key_t;

typedef struct glyph_hash_val_s {
	bitmap_t* bm; // the actual glyph bitmaps
	bitmap_t* bm_o;
	FT_BBox bbox_scaled; // bbox after scaling, but before rotation
	FT_Vector advance; // 26.6, advance distance to the next glyph in line
} glyph_hash_val_t;

void ass_glyph_cache_init(void);
void cache_add_glyph(glyph_hash_key_t* key, glyph_hash_val_t* val);
glyph_hash_val_t* cache_find_glyph(glyph_hash_key_t* key);
void ass_glyph_cache_reset(void);
void ass_glyph_cache_done(void);

#endif