summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorpfaedit <pfaedit>2008-10-28 04:03:11 +0000
committerpfaedit <pfaedit>2008-10-28 04:03:11 +0000
commit5a375e5de022614b83c57799445b8e298ffd4358 (patch)
tree7d4849d1f3494b1209b8422b2379c14a75b0730f /inc
parent18d7938d32d088b3967f7c7a7ff65c1ae3101a52 (diff)
Ok, perhaps cairo shouldn't be on for everything -- it does make stuff rather slow.
Cairo does two things: 1) It gives us fuzzy splines 2) It gives us fuzzy text I want the fuzzy spline option in the outline glyph view (perhaps the bitmap glyph view which will also draw the outline). I want fuzzy text everywhere. But fuzzy text is also done by pango. And if we use pango instead of cairo we get all the nice advanced typography stuff that pango does. So let's use pango. (and cairo -- but just in the outline glyph view).
Diffstat (limited to 'inc')
-rw-r--r--inc/config.h.in1
-rw-r--r--inc/gdraw.h14
-rw-r--r--inc/ustring.h1
3 files changed, 15 insertions, 1 deletions
diff --git a/inc/config.h.in b/inc/config.h.in
index 94bef45b..347f4b74 100644
--- a/inc/config.h.in
+++ b/inc/config.h.in
@@ -61,6 +61,7 @@
#undef X_DISPLAY_MISSING
#undef PYTHON_LIB_NAME
#undef _NO_LIBCAIRO
+#undef _NO_LIBPANGO
#undef WORDS_BIGENDIAN
#endif
diff --git a/inc/gdraw.h b/inc/gdraw.h
index 910afab5..508cf804 100644
--- a/inc/gdraw.h
+++ b/inc/gdraw.h
@@ -238,7 +238,8 @@ typedef struct gwindow_attrs {
wam_noresize=0x2000, wam_restrict=0x4000, wam_redirect=0x8000,
wam_isdlg=0x10000, wam_notrestricted=0x20000,
wam_transient=0x40000,
- wam_utf8_wtitle=0x80000, wam_utf8_ititle=0x100000 } mask;
+ wam_utf8_wtitle=0x80000, wam_utf8_ititle=0x100000,
+ wam_cairo=0x200000 } mask;
uint32 event_masks; /* (1<<et_char) | (1<<et_mouseup) etc */
int16 border_width;
Color border_color; /* Color_UNKNOWN if unspecified */
@@ -300,6 +301,7 @@ enum gzoom_flags { gzf_pos=1, gzf_size=2 };
enum gcairo_flags { gc_buildpath=1, /* Has build path commands (postscript, cairo) */
gc_alpha=2, /* Supports alpha channels & translucent colors (cairo, pdf) */
gc_xor=4, /* Cairo can't do the traditional XOR drawing that X11 does */
+ gc_pango=8,
gc_all = gc_buildpath|gc_alpha
};
@@ -401,15 +403,19 @@ extern int32 GDrawDrawText(GWindow gw, int32 x, int32 y, const unichar_t *txt, i
/* Routines that handle bidirectional text */
/* (slower than the equivalent left to right routines) */
extern int32 GDrawDrawBiText(GWindow gw, int32 x, int32 y, unichar_t *txt, int32 cnt, FontMods *mods, Color col);
+extern int32 GDrawDrawBiText8(GWindow gw, int32 x, int32 y, char *txt, int32 cnt, FontMods *mods, Color col);
extern int32 GDrawGetBiTextWidth(GWindow gw,unichar_t *text, int len, int32 cnt, FontMods *mods);
+extern int32 GDrawGetBiText8Width(GWindow gw,char *text, int len, int32 cnt, FontMods *mods);
extern int32 GDrawGetBiTextPtAfterPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
extern int32 GDrawGetBiTextPtBeforePos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
extern int32 GDrawGetBiTextPtFromPos(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods,
int32 maxwidth, unichar_t **end);
+extern int32 GDrawGetBiTextBounds(GWindow gw,unichar_t *text, int32 cnt, FontMods *mods, GTextBounds *bounds);
extern int GDrawFontHasCharset(FontInstance *fi,/*enum charset*/int charset);
extern int32 GDrawIsAllLeftToRight(unichar_t *text, int32 cnt);
+extern int32 GDrawIsAllLeftToRight8(char *text, int32 cnt);
extern void GDrawBiText1(GBiText *bd, const unichar_t *text, int32 cnt);
extern void GDrawArabicForms(GBiText *bd, int32 start, int32 end);
extern void _GDrawBiText2(GBiText *bd, int32 start, int32 end);
@@ -507,6 +513,12 @@ extern void GDrawCairoBuffer(GWindow w,GRect *size);
extern void GDrawCairoUnbuffer(GWindow w,GRect *size);
extern void GDrawEnableCairo(int on);
+extern void GDrawLayoutInit(GWindow w, char *text, GFont *fi);
+extern void GDrawLayoutDraw(GWindow w, int32 x, int32 y, Color fg);
+extern void GDrawLayoutIndexToPos(GWindow w, int index, GRect *pos);
+extern void GDrawLayoutXYToIndex(GWindow w, int x, int y, int *index);
+extern void GDrawLayoutExtents(GWindow w, GRect *size);
+
extern void GDrawFatalError(const char *fmt,...);
extern void GDrawIError(const char *fmt,...);
extern void GDrawError(const char *fmt,...);
diff --git a/inc/ustring.h b/inc/ustring.h
index 141fd9fd..a5e21e87 100644
--- a/inc/ustring.h
+++ b/inc/ustring.h
@@ -106,6 +106,7 @@ extern int utf8_strlen(const char *utf8_str); /* how many characters in the stri
extern int utf82u_strlen(const char *utf8_str); /* how many long would this be in shorts (UCS2) */
extern char *def2utf8_copy(const char *from);
extern char *utf82def_copy(const char *ufrom);
+extern char *utf8_strchr(const char *utf8_str, int search_char);
extern unichar_t *utf82u_strncpy(unichar_t *ubuf,const char *utf8buf,int len);
extern unichar_t *utf82u_strcpy(unichar_t *ubuf,const char *utf8buf);