# HG changeset patch # User eugeni # Date 1166356855 0 # Node ID 0d8005d2fe5cfc5bfeb5434f052183a6f4a82724 # Parent 1cdd7e6e4e87a58241b74a8f92ab933340fe6420 Update some comments. diff -r 1cdd7e6e4e87 -r 0d8005d2fe5c libass/ass_font.c --- a/libass/ass_font.c Sun Dec 17 10:10:53 2006 +0000 +++ b/libass/ass_font.c Sun Dec 17 12:00:55 2006 +0000 @@ -52,6 +52,9 @@ } } +/** + * \brief find a memory font by name + */ static int find_font(ass_library_t* library, char* name) { int i; @@ -61,6 +64,9 @@ return -1; } +/** + * \brief Create a new ass_font_t according to "desc" argument + */ ass_font_t* ass_font_new(ass_library_t* library, FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* desc) { char* path; @@ -116,6 +122,9 @@ return font; } +/** + * \brief Set font transformation matrix and shift vector + **/ void ass_font_set_transform(ass_font_t* font, FT_Matrix* m, FT_Vector* v) { int i; @@ -129,6 +138,9 @@ FT_Set_Transform(font->faces[i], &font->m, &font->v); } +/** + * \brief Set font size + **/ void ass_font_set_size(ass_font_t* font, int size) { int i; @@ -140,6 +152,10 @@ } #ifdef HAVE_FONTCONFIG +/** + * \brief Select a new FT_Face with the given character + * The new face is added to the end of font->faces. + **/ static void ass_font_reselect(void* fontconfig_priv, ass_font_t* font, uint32_t ch) { char* path; @@ -173,6 +189,11 @@ } #endif +/** + * \brief Get maximal font ascender and descender. + * \param ch character code + * The values are extracted from the font face that provides glyphs for the given character + **/ void ass_font_get_asc_desc(ass_font_t* font, uint32_t ch, int* asc, int* desc) { int i; @@ -194,6 +215,10 @@ *asc = *desc = 0; } +/** + * \brief Get a glyph + * \param ch character code + **/ FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch) { int error; @@ -253,6 +278,9 @@ return glyph; } +/** + * \brief Get kerning for the pair of glyphs. + **/ FT_Vector ass_font_get_kerning(ass_font_t* font, uint32_t c1, uint32_t c2) { FT_Vector v = {0, 0}; @@ -273,6 +301,9 @@ return v; } +/** + * \brief Deallocate ass_font_t + **/ void ass_font_free(ass_font_t* font) { int i; diff -r 1cdd7e6e4e87 -r 0d8005d2fe5c libass/ass_fontconfig.c --- a/libass/ass_fontconfig.c Sun Dec 17 10:10:53 2006 +0000 +++ b/libass/ass_fontconfig.c Sun Dec 17 12:00:55 2006 +0000 @@ -54,6 +54,7 @@ * \param bold font weight value * \param italic font slant value * \param index out: font index inside a file + * \param charset: contains the characters that should be present in the font, can be NULL * \return font file path */ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, @@ -150,6 +151,7 @@ * \param bold font weight value * \param italic font slant value * \param index out: font index inside a file + * \param charset: contains the characters that should be present in the font, can be NULL * \return font file path */ char* fontconfig_select_with_charset(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index, @@ -224,10 +226,13 @@ } /** - * \brief Process embedded matroska font. Saves it to ~/.mplayer/fonts. - * \param name attachment name - * \param data binary font data - * \param data_size data size + * \brief Process memory font. + * \param priv private data + * \param library library object + * \param ftlibrary freetype library object + * \param idx index of the processed font in library->fontdata + * With FontConfig >= 2.4.2, builds a font pattern in memory via FT_New_Memory_Face/FcFreeTypeQueryFace. + * With older FontConfig versions, save the font to ~/.mplayer/fonts. */ static void process_fontdata(fc_instance_t* priv, ass_library_t* library, FT_Library ftlibrary, int idx) { @@ -309,7 +314,8 @@ /** * \brief Init fontconfig. - * \param dir additional directoryu for fonts + * \param library libass library object + * \param ftlibrary freetype library object * \param family default font family * \param path default font path * \return pointer to fontconfig private data @@ -385,7 +391,7 @@ return priv; } -#else +#else // HAVE_FONTCONFIG char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index) {