diff options
| author | YAMAMOTO Mitsuharu | 2005-11-19 06:35:19 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2005-11-19 06:35:19 +0000 |
| commit | 6b9ad469e2e14902f8dc49168df2bebae0293eec (patch) | |
| tree | 928da07f81773c17585392e8adaf1e7ba58cd842 /src | |
| parent | ed256b30574ccaeb894c34369f79f4dd082bbd6a (diff) | |
| download | emacs-6b9ad469e2e14902f8dc49168df2bebae0293eec.tar.gz emacs-6b9ad469e2e14902f8dc49168df2bebae0293eec.zip | |
[USE_CG_TEXT_DRAWING] (cg_text_anti_aliasing_threshold): New variable.
[USE_CG_TEXT_DRAWING] (init_cg_text_anti_aliasing_threshold): New function.
(init_font_name_table) [USE_ATSUI && USE_CG_TEXT_DRAWING]: Use it.
[USE_CG_TEXT_DRAWING] (mac_draw_string_cg): Don't do antialiasing if
font size is smaller than or equal to cg_text_anti_aliasing_threshold.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/macterm.c b/src/macterm.c index 5ac3255daca..1153efda18c 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -867,6 +867,19 @@ mac_draw_image_string_16 (f, gc, x, y, buf, nchars) | |||
| 867 | #if USE_CG_TEXT_DRAWING | 867 | #if USE_CG_TEXT_DRAWING |
| 868 | static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); | 868 | static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); |
| 869 | 869 | ||
| 870 | static int cg_text_anti_aliasing_threshold = 8; | ||
| 871 | |||
| 872 | static void | ||
| 873 | init_cg_text_anti_aliasing_threshold () | ||
| 874 | { | ||
| 875 | Lisp_Object val = | ||
| 876 | Fmac_get_preference (build_string ("AppleAntiAliasingThreshold"), | ||
| 877 | Qnil, Qnil, Qnil); | ||
| 878 | |||
| 879 | if (INTEGERP (val)) | ||
| 880 | cg_text_anti_aliasing_threshold = XINT (val); | ||
| 881 | } | ||
| 882 | |||
| 870 | static int | 883 | static int |
| 871 | mac_draw_string_cg (f, gc, x, y, buf, nchars) | 884 | mac_draw_string_cg (f, gc, x, y, buf, nchars) |
| 872 | struct frame *f; | 885 | struct frame *f; |
| @@ -915,6 +928,8 @@ mac_draw_string_cg (f, gc, x, y, buf, nchars) | |||
| 915 | 1.0); | 928 | 1.0); |
| 916 | CGContextSetFont (context, GC_FONT (gc)->cg_font); | 929 | CGContextSetFont (context, GC_FONT (gc)->cg_font); |
| 917 | CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); | 930 | CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); |
| 931 | if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold) | ||
| 932 | CGContextSetShouldAntialias (context, false); | ||
| 918 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 | 933 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
| 919 | CGContextSetTextPosition (context, gx, gy); | 934 | CGContextSetTextPosition (context, gx, gy); |
| 920 | CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); | 935 | CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); |
| @@ -6784,6 +6799,9 @@ init_font_name_table () | |||
| 6784 | text_encoding_info_alist = create_text_encoding_info_alist (); | 6799 | text_encoding_info_alist = create_text_encoding_info_alist (); |
| 6785 | 6800 | ||
| 6786 | #if USE_ATSUI | 6801 | #if USE_ATSUI |
| 6802 | #if USE_CG_TEXT_DRAWING | ||
| 6803 | init_cg_text_anti_aliasing_threshold (); | ||
| 6804 | #endif | ||
| 6787 | if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), | 6805 | if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), |
| 6788 | text_encoding_info_alist))) | 6806 | text_encoding_info_alist))) |
| 6789 | { | 6807 | { |