867 |
#if USE_CG_TEXT_DRAWING |
#if USE_CG_TEXT_DRAWING |
868 |
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); |
static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *)); |
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 |
|
|
883 |
static int |
static int |
884 |
mac_draw_string_cg (f, gc, x, y, buf, nchars) |
mac_draw_string_cg (f, gc, x, y, buf, nchars) |
885 |
struct frame *f; |
struct frame *f; |
928 |
1.0); |
1.0); |
929 |
CGContextSetFont (context, GC_FONT (gc)->cg_font); |
CGContextSetFont (context, GC_FONT (gc)->cg_font); |
930 |
CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); |
CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize); |
931 |
|
if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold) |
932 |
|
CGContextSetShouldAntialias (context, false); |
933 |
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 |
934 |
CGContextSetTextPosition (context, gx, gy); |
CGContextSetTextPosition (context, gx, gy); |
935 |
CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); |
CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars); |
6799 |
text_encoding_info_alist = create_text_encoding_info_alist (); |
text_encoding_info_alist = create_text_encoding_info_alist (); |
6800 |
|
|
6801 |
#if USE_ATSUI |
#if USE_ATSUI |
6802 |
|
#if USE_CG_TEXT_DRAWING |
6803 |
|
init_cg_text_anti_aliasing_threshold (); |
6804 |
|
#endif |
6805 |
if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), |
if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), |
6806 |
text_encoding_info_alist))) |
text_encoding_info_alist))) |
6807 |
{ |
{ |