diff options
| author | Glenn Morris | 2019-01-07 11:51:23 -0800 |
|---|---|---|
| committer | Glenn Morris | 2019-01-07 11:51:23 -0800 |
| commit | 2c2bcc4ace55215f4ff6ea5026f100c209d8ad2e (patch) | |
| tree | cb3a7d0b50efe2e6412e410c7536377b507fe309 /src/font.h | |
| parent | 6ab2bf329f4165e6db4b0424c37d0da8e2c0e53e (diff) | |
| parent | 0ecff00bc19c0f8e1b2c0b552a7a686525377dad (diff) | |
| download | emacs-2c2bcc4ace55215f4ff6ea5026f100c209d8ad2e.tar.gz emacs-2c2bcc4ace55215f4ff6ea5026f100c209d8ad2e.zip | |
Merge from origin/emacs-26
0ecff00 Improve commentary in font.h
a058eda Fix definition of Qwindow_point_insertion_type (Bug#33871)
Diffstat (limited to 'src/font.h')
| -rw-r--r-- | src/font.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/font.h b/src/font.h index 741bc1033f3..620dd904a00 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -284,7 +284,7 @@ struct font | |||
| 284 | /* By which pixel size the font is opened. */ | 284 | /* By which pixel size the font is opened. */ |
| 285 | int pixel_size; | 285 | int pixel_size; |
| 286 | 286 | ||
| 287 | /* Height of the font. On X window, this is the same as | 287 | /* Height of the font. On X window system, this is the same as |
| 288 | (font->ascent + font->descent). */ | 288 | (font->ascent + font->descent). */ |
| 289 | int height; | 289 | int height; |
| 290 | 290 | ||
| @@ -293,7 +293,7 @@ struct font | |||
| 293 | int space_width; | 293 | int space_width; |
| 294 | 294 | ||
| 295 | /* Average width of glyphs in the font. If the font itself doesn't | 295 | /* Average width of glyphs in the font. If the font itself doesn't |
| 296 | have that information but has glyphs of ASCII characters, the | 296 | have that information, but has glyphs of ASCII characters, the |
| 297 | value is the average width of those glyphs. Otherwise, the value | 297 | value is the average width of those glyphs. Otherwise, the value |
| 298 | is 0. */ | 298 | is 0. */ |
| 299 | int average_width; | 299 | int average_width; |
| @@ -576,8 +576,8 @@ struct font_driver | |||
| 576 | cons whose cdr part is the actual cache area. */ | 576 | cons whose cdr part is the actual cache area. */ |
| 577 | Lisp_Object (*get_cache) (struct frame *f); | 577 | Lisp_Object (*get_cache) (struct frame *f); |
| 578 | 578 | ||
| 579 | /* List fonts exactly matching with FONT_SPEC on FRAME. The value | 579 | /* List fonts exactly matching FONT_SPEC on FRAME. The value is |
| 580 | is a list of font-entities. The font properties to be considered | 580 | a list of font-entities. The font properties to be considered |
| 581 | are: :foundry, :family, :adstyle, :registry, :script, :lang, and | 581 | are: :foundry, :family, :adstyle, :registry, :script, :lang, and |
| 582 | :otf. See the function `font-spec' for their meanings. Note | 582 | :otf. See the function `font-spec' for their meanings. Note |
| 583 | that the last three properties are stored in FONT_EXTRA_INDEX | 583 | that the last three properties are stored in FONT_EXTRA_INDEX |
| @@ -593,19 +593,19 @@ struct font_driver | |||
| 593 | The `open' method of the same font-backend is called with one of | 593 | The `open' method of the same font-backend is called with one of |
| 594 | the returned font-entities. If the backend needs additional | 594 | the returned font-entities. If the backend needs additional |
| 595 | information to be used in `open' method, this method can add any | 595 | information to be used in `open' method, this method can add any |
| 596 | Lispy value by the property :font-entity to the entities. | 596 | Lispy value using the property :font-entity to the entities. |
| 597 | 597 | ||
| 598 | This and the following `match' are the only APIs that allocate | 598 | This and the following `match' are the only APIs that allocate |
| 599 | font-entities. */ | 599 | font-entities. */ |
| 600 | Lisp_Object (*list) (struct frame *frame, Lisp_Object font_spec); | 600 | Lisp_Object (*list) (struct frame *frame, Lisp_Object font_spec); |
| 601 | 601 | ||
| 602 | /* Return a font-entity most closely matching with FONT_SPEC on | 602 | /* Return a font-entity most closely matching FONT_SPEC on FRAME. |
| 603 | FRAME. Which font property to consider, and how to calculate the | 603 | Which font property to consider, and how to calculate the |
| 604 | closeness is determined by the font backend, thus | 604 | closeness, is determined by the font backend, thus |
| 605 | `face-font-selection-order' is ignored here. | 605 | `face-font-selection-order' is ignored here. |
| 606 | 606 | ||
| 607 | The properties that the font-entity has is the same as `list' | 607 | The properties that the font-entity has are the same as described |
| 608 | method. */ | 608 | for the `list' method above. */ |
| 609 | Lisp_Object (*match) (struct frame *f, Lisp_Object spec); | 609 | Lisp_Object (*match) (struct frame *f, Lisp_Object spec); |
| 610 | 610 | ||
| 611 | /* Optional. | 611 | /* Optional. |
| @@ -630,7 +630,7 @@ struct font_driver | |||
| 630 | void (*prepare_face) (struct frame *f, struct face *face); | 630 | void (*prepare_face) (struct frame *f, struct face *face); |
| 631 | 631 | ||
| 632 | /* Optional. | 632 | /* Optional. |
| 633 | Done FACE for displaying characters by FACE->font on frame F. */ | 633 | Done with FACE for displaying characters by FACE->font on frame F. */ |
| 634 | void (*done_face) (struct frame *f, struct face *face); | 634 | void (*done_face) (struct frame *f, struct face *face); |
| 635 | 635 | ||
| 636 | /* Optional. | 636 | /* Optional. |
| @@ -662,8 +662,8 @@ struct font_driver | |||
| 662 | 662 | ||
| 663 | /* Optional. | 663 | /* Optional. |
| 664 | Store bitmap data for glyph-code CODE of FONT in BITMAP. It is | 664 | Store bitmap data for glyph-code CODE of FONT in BITMAP. It is |
| 665 | intended that this method is called from the other font-driver | 665 | intended that this method is called from other font-driver |
| 666 | for actual drawing. */ | 666 | methods for actual drawing. */ |
| 667 | int (*get_bitmap) (struct font *font, unsigned code, | 667 | int (*get_bitmap) (struct font *font, unsigned code, |
| 668 | struct font_bitmap *bitmap, | 668 | struct font_bitmap *bitmap, |
| 669 | int bits_per_pixel); | 669 | int bits_per_pixel); |
| @@ -677,13 +677,16 @@ struct font_driver | |||
| 677 | /* Optional. | 677 | /* Optional. |
| 678 | Get coordinates of the INDEXth anchor point of the glyph whose | 678 | Get coordinates of the INDEXth anchor point of the glyph whose |
| 679 | code is CODE. Store the coordinates in *X and *Y. Return 0 if | 679 | code is CODE. Store the coordinates in *X and *Y. Return 0 if |
| 680 | the operations was successful. Otherwise return -1. */ | 680 | the operation was successful. Otherwise return -1. */ |
| 681 | int (*anchor_point) (struct font *font, unsigned code, int index, | 681 | int (*anchor_point) (struct font *font, unsigned code, int index, |
| 682 | int *x, int *y); | 682 | int *x, int *y); |
| 683 | 683 | ||
| 684 | /* Optional. | 684 | /* Optional. |
| 685 | Return a list describing which scripts/languages FONT | 685 | Return a list describing which scripts/languages FONT |
| 686 | supports by which GSUB/GPOS features of OpenType tables. */ | 686 | supports by which GSUB/GPOS features of OpenType tables. |
| 687 | The list should be of the form (GSUB GPOS), where both | ||
| 688 | GSUB and GPOS are lists of the form | ||
| 689 | ((SCRIPT (LANGSYS FEATURE ...) ...) ...) */ | ||
| 687 | Lisp_Object (*otf_capability) (struct font *font); | 690 | Lisp_Object (*otf_capability) (struct font *font); |
| 688 | 691 | ||
| 689 | /* Optional. | 692 | /* Optional. |
| @@ -707,17 +710,16 @@ struct font_driver | |||
| 707 | 710 | ||
| 708 | /* Optional. | 711 | /* Optional. |
| 709 | Make the font driver ready for frame F. Usually this function | 712 | Make the font driver ready for frame F. Usually this function |
| 710 | makes some data specific to F and stores it in F by calling | 713 | makes some data specific to F and stores it in F's font_data |
| 711 | font_put_frame_data (). */ | 714 | member by calling font_put_frame_data. */ |
| 712 | int (*start_for_frame) (struct frame *f); | 715 | int (*start_for_frame) (struct frame *f); |
| 713 | 716 | ||
| 714 | /* Optional. | 717 | /* Optional. |
| 715 | End using the driver for frame F. Usually this function free | 718 | End using the driver for frame F. Usually this function frees |
| 716 | some data stored for F. */ | 719 | some font data stored in frame F's font_data member. */ |
| 717 | int (*end_for_frame) (struct frame *f); | 720 | int (*end_for_frame) (struct frame *f); |
| 718 | 721 | ||
| 719 | /* Optional. | 722 | /* Optional. |
| 720 | |||
| 721 | Shape text in GSTRING. See the docstring of | 723 | Shape text in GSTRING. See the docstring of |
| 722 | `composition-get-gstring' for the format of GSTRING. If the | 724 | `composition-get-gstring' for the format of GSTRING. If the |
| 723 | (N+1)th element of GSTRING is nil, input of shaping is from the | 725 | (N+1)th element of GSTRING is nil, input of shaping is from the |
| @@ -728,19 +730,17 @@ struct font_driver | |||
| 728 | output glyphs (M) are more than the input glyphs (N), (N+1)th | 730 | output glyphs (M) are more than the input glyphs (N), (N+1)th |
| 729 | through (M)th elements of GSTRING are updated possibly by making | 731 | through (M)th elements of GSTRING are updated possibly by making |
| 730 | a new glyph object and storing it in GSTRING. If (M) is greater | 732 | a new glyph object and storing it in GSTRING. If (M) is greater |
| 731 | than the length of GSTRING, nil should be return. In that case, | 733 | than the length of GSTRING, this method should return nil. In |
| 732 | this function is called again with the larger GSTRING. */ | 734 | that case, the method is called again with a larger GSTRING. */ |
| 733 | Lisp_Object (*shape) (Lisp_Object lgstring); | 735 | Lisp_Object (*shape) (Lisp_Object lgstring); |
| 734 | 736 | ||
| 735 | /* Optional. | 737 | /* Optional. |
| 736 | |||
| 737 | If FONT is usable on frame F, return 0. Otherwise return -1. | 738 | If FONT is usable on frame F, return 0. Otherwise return -1. |
| 738 | This method is used only for debugging. If this method is NULL, | 739 | This method is used only for debugging. If this method is NULL, |
| 739 | Emacs assumes that the font is usable on any frame. */ | 740 | Emacs assumes that the font is usable on any frame. */ |
| 740 | int (*check) (struct frame *f, struct font *font); | 741 | int (*check) (struct frame *f, struct font *font); |
| 741 | 742 | ||
| 742 | /* Optional. | 743 | /* Optional. |
| 743 | |||
| 744 | Return the number of variation glyphs of character C supported by | 744 | Return the number of variation glyphs of character C supported by |
| 745 | FONT. VARIATIONS is an array of 256 elements. If the variation | 745 | FONT. VARIATIONS is an array of 256 elements. If the variation |
| 746 | selector N (1..256) defines a glyph, that glyph code is stored in | 746 | selector N (1..256) defines a glyph, that glyph code is stored in |
| @@ -748,24 +748,27 @@ struct font_driver | |||
| 748 | int (*get_variation_glyphs) (struct font *font, | 748 | int (*get_variation_glyphs) (struct font *font, |
| 749 | int c, unsigned variations[256]); | 749 | int c, unsigned variations[256]); |
| 750 | 750 | ||
| 751 | /* Optional. | ||
| 752 | Set attributes of FONT according to PROPERTIES. | ||
| 753 | PROPERTIES is an alist of pairs (KEY . VALUE) that specifies | ||
| 754 | font properties. This method should use font-put to set | ||
| 755 | properties of FONT supported by the font driver. | ||
| 756 | See font_filter_properties for more details. */ | ||
| 751 | void (*filter_properties) (Lisp_Object font, Lisp_Object properties); | 757 | void (*filter_properties) (Lisp_Object font, Lisp_Object properties); |
| 752 | 758 | ||
| 753 | /* Optional. | 759 | /* Optional. |
| 754 | |||
| 755 | Return non-zero if FONT_OBJECT can be used as a (cached) font | 760 | Return non-zero if FONT_OBJECT can be used as a (cached) font |
| 756 | for ENTITY on frame F. */ | 761 | for ENTITY on frame F. */ |
| 757 | bool (*cached_font_ok) (struct frame *f, | 762 | bool (*cached_font_ok) (struct frame *f, |
| 758 | Lisp_Object font_object, | 763 | Lisp_Object font_object, |
| 759 | Lisp_Object entity); | 764 | Lisp_Object entity); |
| 760 | 765 | ||
| 761 | /* Optional | 766 | /* Optional. |
| 762 | 767 | Return non-nil if the driver supports rendering of combining | |
| 763 | Return non-nil if the driver support rendering of combining | ||
| 764 | characters for FONT according to Unicode combining class. */ | 768 | characters for FONT according to Unicode combining class. */ |
| 765 | Lisp_Object (*combining_capability) (struct font *font); | 769 | Lisp_Object (*combining_capability) (struct font *font); |
| 766 | 770 | ||
| 767 | /* Optional | 771 | /* Optional. |
| 768 | |||
| 769 | Called when frame F is double-buffered and its size changes; Xft | 772 | Called when frame F is double-buffered and its size changes; Xft |
| 770 | relies on this hook to throw away its old XftDraw (which won't | 773 | relies on this hook to throw away its old XftDraw (which won't |
| 771 | work after the size change) and get a new one. */ | 774 | work after the size change) and get a new one. */ |