diff options
| author | Kenichi Handa | 2006-06-16 12:36:28 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2006-06-16 12:36:28 +0000 |
| commit | 217caa37994c3ab9a647b28abdb765f19e088d36 (patch) | |
| tree | 231c129893a6f1f1180116c43fa5cdb7b23e6df1 /src | |
| parent | ef18374fba5547c616da8b449232566fb7de58cb (diff) | |
| download | emacs-217caa37994c3ab9a647b28abdb765f19e088d36.tar.gz emacs-217caa37994c3ab9a647b28abdb765f19e088d36.zip | |
(struct font_driver): Member parse_name deleted.
(font_match_p, font_get_spec, font_parse_fcname)
(font_unparse_fcname): Extern them.
(font_get_name): Prototype adjusted.
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.h | 91 |
1 files changed, 49 insertions, 42 deletions
diff --git a/src/font.h b/src/font.h index 7d672544fca..f3bf8451162 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -258,6 +258,8 @@ struct composition; | |||
| 258 | 258 | ||
| 259 | #define FONT_INVALID_CODE 0xFFFFFFFF | 259 | #define FONT_INVALID_CODE 0xFFFFFFFF |
| 260 | 260 | ||
| 261 | /* Font driver. Members specified as "optional" can be NULL. */ | ||
| 262 | |||
| 261 | struct font_driver | 263 | struct font_driver |
| 262 | { | 264 | { |
| 263 | /* Symbol indicating the type of the font-driver. */ | 265 | /* Symbol indicating the type of the font-driver. */ |
| @@ -267,23 +269,18 @@ struct font_driver | |||
| 267 | cons whose cdr part is the actual cache area. */ | 269 | cons whose cdr part is the actual cache area. */ |
| 268 | Lisp_Object (*get_cache) P_ ((Lisp_Object frame)); | 270 | Lisp_Object (*get_cache) P_ ((Lisp_Object frame)); |
| 269 | 271 | ||
| 270 | /* Parse font name NAME, store the font properties in SPEC, and | ||
| 271 | return 0. If the font-driver can't parse NAME, return -1. */ | ||
| 272 | int (*parse_name) P_ ((FRAME_PTR f, char *name, Lisp_Object spec)); | ||
| 273 | |||
| 274 | /* List fonts matching with FONT_SPEC on FRAME. The value is a | 272 | /* List fonts matching with FONT_SPEC on FRAME. The value is a |
| 275 | vector of font-entities. This is the sole API that allocates | 273 | vector of font-entities. This is the sole API that allocates |
| 276 | font-entities. */ | 274 | font-entities. */ |
| 277 | Lisp_Object (*list) P_ ((Lisp_Object frame, Lisp_Object font_spec)); | 275 | Lisp_Object (*list) P_ ((Lisp_Object frame, Lisp_Object font_spec)); |
| 278 | 276 | ||
| 279 | /* List available families. The value is a list of family names | 277 | /* Optional. |
| 280 | (symbols). The method can be NULL if the driver doesn't support | 278 | List available families. The value is a list of family names |
| 281 | this facility. */ | 279 | (symbols). */ |
| 282 | Lisp_Object (*list_family) P_ ((Lisp_Object frame)); | 280 | Lisp_Object (*list_family) P_ ((Lisp_Object frame)); |
| 283 | 281 | ||
| 284 | /* Free FONT_EXTRA_INDEX field of FONT_ENTITY. This method can be | 282 | /* Optional (if FONT_EXTRA_INDEX is not Lisp_Save_Value). |
| 285 | NULL if FONT_EXTRA_INDEX of FONT_ENTITY is a normal Lisp object | 283 | Free FONT_EXTRA_INDEX field of FONT_ENTITY. */ |
| 286 | (i.e. not Lisp_Save_Value). */ | ||
| 287 | void (*free_entity) P_ ((Lisp_Object font_entity)); | 284 | void (*free_entity) P_ ((Lisp_Object font_entity)); |
| 288 | 285 | ||
| 289 | /* Open a font specified by FONT_ENTITY on frame F. If the font is | 286 | /* Open a font specified by FONT_ENTITY on frame F. If the font is |
| @@ -294,24 +291,24 @@ struct font_driver | |||
| 294 | /* Close FONT on frame F. */ | 291 | /* Close FONT on frame F. */ |
| 295 | void (*close) P_ ((FRAME_PTR f, struct font *font)); | 292 | void (*close) P_ ((FRAME_PTR f, struct font *font)); |
| 296 | 293 | ||
| 297 | /* Prepare FACE for displaying characters by FONT on frame F. If | 294 | /* Optional (if FACE->extra is not used). |
| 298 | successful, return 0. Otherwise, return -1. This method can be | 295 | Prepare FACE for displaying characters by FONT on frame F by |
| 299 | NULL if there's nothing to do. */ | 296 | storing some data in FACE->extra. If successful, return 0. |
| 297 | Otherwise, return -1. */ | ||
| 300 | int (*prepare_face) P_ ((FRAME_PTR f, struct face *face)); | 298 | int (*prepare_face) P_ ((FRAME_PTR f, struct face *face)); |
| 301 | 299 | ||
| 302 | /* Done FACE for displaying characters by FACE->font on frame F. | 300 | /* Optional. |
| 303 | This method can be NULL if there's nothing to do. */ | 301 | Done FACE for displaying characters by FACE->font on frame F. */ |
| 304 | void (*done_face) P_ ((FRAME_PTR f, struct face *face)); | 302 | void (*done_face) P_ ((FRAME_PTR f, struct face *face)); |
| 305 | 303 | ||
| 306 | /* If FONT_ENTITY has a glyph for character C, return 1. If not, | 304 | /* Optional. |
| 307 | return 0. If a font must be opened to check it, return -1. This | 305 | If FONT_ENTITY has a glyph for character C (Unicode code point), |
| 308 | method can be NULL if the driver always requires a font to be | 306 | return 1. If not, return 0. If a font must be opened to check |
| 309 | opened for this check. In that case, we must open a font and use | 307 | it, return -1. */ |
| 310 | `encode_char' method. */ | ||
| 311 | int (*has_char) P_ ((Lisp_Object entity, int c)); | 308 | int (*has_char) P_ ((Lisp_Object entity, int c)); |
| 312 | 309 | ||
| 313 | /* Return a glyph code of FONT for characer C. If FONT doesn't have | 310 | /* Return a glyph code of FONT for characer C (Unicode code point). |
| 314 | such a glyph, return FONT_INVALID_CODE. */ | 311 | If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ |
| 315 | unsigned (*encode_char) P_ ((struct font *font, int c)); | 312 | unsigned (*encode_char) P_ ((struct font *font, int c)); |
| 316 | 313 | ||
| 317 | /* Perform the size computation of glyphs of FONT and fillin members | 314 | /* Perform the size computation of glyphs of FONT and fillin members |
| @@ -321,46 +318,49 @@ struct font_driver | |||
| 321 | unsigned *code, int nglyphs, | 318 | unsigned *code, int nglyphs, |
| 322 | struct font_metrics *metrics)); | 319 | struct font_metrics *metrics)); |
| 323 | 320 | ||
| 324 | /* Draw glyphs between FROM and TO of S->char2b at (X Y) pixel | 321 | /* Optional. |
| 322 | Draw glyphs between FROM and TO of S->char2b at (X Y) pixel | ||
| 325 | position of frame F with S->FACE and S->GC. If WITH_BACKGROUND | 323 | position of frame F with S->FACE and S->GC. If WITH_BACKGROUND |
| 326 | is nonzero, fill the background in advance. It is assured that | 324 | is nonzero, fill the background in advance. It is assured that |
| 327 | WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */ | 325 | WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */ |
| 328 | int (*draw) P_ ((struct glyph_string *s, int from, int to, | 326 | int (*draw) P_ ((struct glyph_string *s, int from, int to, |
| 329 | int x, int y, int with_background)); | 327 | int x, int y, int with_background)); |
| 330 | 328 | ||
| 331 | /* Store bitmap data for glyph-code CODE of FONT in BITMAP. This | 329 | /* Optional. |
| 332 | method can be NULL if the driver doesn't support this facility. | 330 | Store bitmap data for glyph-code CODE of FONT in BITMAP. It is |
| 333 | It is intended that this method is callled from the other | 331 | intended that this method is callled from the other font-driver |
| 334 | font-driver for actual drawing. */ | 332 | for actual drawing. */ |
| 335 | int (*get_bitmap) P_ ((struct font *font, unsigned code, | 333 | int (*get_bitmap) P_ ((struct font *font, unsigned code, |
| 336 | struct font_bitmap *bitmap, | 334 | struct font_bitmap *bitmap, |
| 337 | int bits_per_pixel)); | 335 | int bits_per_pixel)); |
| 338 | 336 | ||
| 339 | /* Free bitmap data in BITMAP. This method can be NULL if no data | 337 | /* Optional. |
| 340 | have to be freed. */ | 338 | Free bitmap data in BITMAP. */ |
| 341 | void (*free_bitmap) P_ ((struct font *font, struct font_bitmap *bitmap)); | 339 | void (*free_bitmap) P_ ((struct font *font, struct font_bitmap *bitmap)); |
| 342 | 340 | ||
| 343 | /* Return an outline data for glyph-code CODE of FONT. The format | 341 | /* Optional. |
| 344 | of the outline data depends on the font-driver. This method can | 342 | Return an outline data for glyph-code CODE of FONT. The format |
| 345 | be NULL if the driver doesn't support this facility. */ | 343 | of the outline data depends on the font-driver. */ |
| 346 | void *(*get_outline) P_ ((struct font *font, unsigned code)); | 344 | void *(*get_outline) P_ ((struct font *font, unsigned code)); |
| 347 | 345 | ||
| 348 | /* Free OUTLINE (that is obtained by the above method). */ | 346 | /* Optional. |
| 347 | Free OUTLINE (that is obtained by the above method). */ | ||
| 349 | void (*free_outline) P_ ((struct font *font, void *outline)); | 348 | void (*free_outline) P_ ((struct font *font, void *outline)); |
| 350 | 349 | ||
| 351 | /* Get coordinates of the INDEXth anchor point of the glyph whose | 350 | /* Optional. |
| 351 | Get coordinates of the INDEXth anchor point of the glyph whose | ||
| 352 | code is CODE. Store the coordinates in *X and *Y. Return 0 if | 352 | code is CODE. Store the coordinates in *X and *Y. Return 0 if |
| 353 | the operations was successfull. Otherwise return -1. This | 353 | the operations was successfull. Otherwise return -1. */ |
| 354 | method can be NULL if the driver doesn't support this | ||
| 355 | facility. */ | ||
| 356 | int (*anchor_point) P_ ((struct font *font, unsigned code, int index, | 354 | int (*anchor_point) P_ ((struct font *font, unsigned code, int index, |
| 357 | int *x, int *y)); | 355 | int *x, int *y)); |
| 358 | 356 | ||
| 359 | /* Return a list describing which scripts/languages FONT | 357 | /* Optional. |
| 358 | Return a list describing which scripts/languages FONT | ||
| 360 | supports by which GSUB/GPOS features of OpenType tables. */ | 359 | supports by which GSUB/GPOS features of OpenType tables. */ |
| 361 | Lisp_Object (*otf_capability) P_ ((struct font *font)); | 360 | Lisp_Object (*otf_capability) P_ ((struct font *font)); |
| 362 | 361 | ||
| 363 | /* Drive FONT's OTF GSUB features according to GSUB_SPEC. | 362 | /* Optional. |
| 363 | Drive FONT's OTF GSUB features according to GSUB_SPEC. | ||
| 364 | 364 | ||
| 365 | GSUB_SPEC is in this format (all elements are symbols): | 365 | GSUB_SPEC is in this format (all elements are symbols): |
| 366 | (SCRIPT LANGSYS GSUB-FEATURE ...) | 366 | (SCRIPT LANGSYS GSUB-FEATURE ...) |
| @@ -384,7 +384,8 @@ struct font_driver | |||
| 384 | Lisp_Object gstring_in, int from, int to, | 384 | Lisp_Object gstring_in, int from, int to, |
| 385 | Lisp_Object gstring_out, int idx)); | 385 | Lisp_Object gstring_out, int idx)); |
| 386 | 386 | ||
| 387 | /* Drive FONT's OTF GPOS features according to GPOS_SPEC. | 387 | /* Optional. |
| 388 | Drive FONT's OTF GPOS features according to GPOS_SPEC. | ||
| 388 | 389 | ||
| 389 | GPOS_SPEC is in this format (all elements are symbols): | 390 | GPOS_SPEC is in this format (all elements are symbols): |
| 390 | (SCRIPT LANGSYS GPOS-FEATURE ...) | 391 | (SCRIPT LANGSYS GPOS-FEATURE ...) |
| @@ -416,9 +417,12 @@ extern Lisp_Object font_symbolic_weight P_ ((Lisp_Object font)); | |||
| 416 | extern Lisp_Object font_symbolic_slant P_ ((Lisp_Object font)); | 417 | extern Lisp_Object font_symbolic_slant P_ ((Lisp_Object font)); |
| 417 | extern Lisp_Object font_symbolic_width P_ ((Lisp_Object font)); | 418 | extern Lisp_Object font_symbolic_width P_ ((Lisp_Object font)); |
| 418 | 419 | ||
| 420 | extern int font_match_p P_ ((Lisp_Object spec, Lisp_Object entity)); | ||
| 421 | |||
| 419 | extern Lisp_Object font_find_object P_ ((struct font *font)); | 422 | extern Lisp_Object font_find_object P_ ((struct font *font)); |
| 420 | extern char *font_get_name P_ ((Lisp_Object)); | 423 | extern Lisp_Object font_get_name P_ ((Lisp_Object font_object)); |
| 421 | extern Lisp_Object font_get_frame P_ ((Lisp_Object font)); | 424 | extern Lisp_Object font_get_spec P_ ((Lisp_Object font_object)); |
| 425 | extern Lisp_Object font_get_frame P_ ((Lisp_Object font_object)); | ||
| 422 | extern int font_has_char P_ ((FRAME_PTR, Lisp_Object, int)); | 426 | extern int font_has_char P_ ((FRAME_PTR, Lisp_Object, int)); |
| 423 | extern unsigned font_encode_char P_ ((Lisp_Object, int)); | 427 | extern unsigned font_encode_char P_ ((Lisp_Object, int)); |
| 424 | 428 | ||
| @@ -444,6 +448,9 @@ extern void font_parse_old_font_spec P_ ((Lisp_Object, Lisp_Object, | |||
| 444 | extern int font_parse_xlfd P_ ((char *name, Lisp_Object font, int merge)); | 448 | extern int font_parse_xlfd P_ ((char *name, Lisp_Object font, int merge)); |
| 445 | extern int font_unparse_xlfd P_ ((Lisp_Object font, int pixel_size, | 449 | extern int font_unparse_xlfd P_ ((Lisp_Object font, int pixel_size, |
| 446 | char *name, int bytes)); | 450 | char *name, int bytes)); |
| 451 | extern int font_parse_fcname P_ ((char *name, Lisp_Object font, int merge)); | ||
| 452 | extern int font_unparse_fcname P_ ((Lisp_Object font, int pixel_size, | ||
| 453 | char *name, int bytes)); | ||
| 447 | extern void register_font_driver P_ ((struct font_driver *driver, FRAME_PTR f)); | 454 | extern void register_font_driver P_ ((struct font_driver *driver, FRAME_PTR f)); |
| 448 | extern void free_font_driver_list P_ ((FRAME_PTR f)); | 455 | extern void free_font_driver_list P_ ((FRAME_PTR f)); |
| 449 | 456 | ||