From 208c51bee03e50ebeff32d63843394d3bd41ee23 Mon Sep 17 00:00:00 2001 From: joye Date: Mon, 9 Dec 2013 21:26:21 +0000 Subject: *** empty log message *** --- Makefile.in | 2 +- aclocal.m4 | 69 --------------------------- configure | 132 +--------------------------------------------------- configure.in | 1 - src/bltConfig.C | 32 ------------- src/bltGrAxis.C | 10 ++-- src/bltGrAxis.h | 4 +- src/bltGrElemBar.C | 4 +- src/bltGrElemLine.C | 4 +- src/bltGrLegd.C | 16 +++---- src/bltGrMarker.C | 2 +- src/bltGrPSOutput.C | 10 +++- src/bltGrPSOutput.h | 6 +-- src/bltGrText.C | 72 ++++++++++++++-------------- src/bltGrText.h | 4 +- src/bltGraph.C | 2 +- 16 files changed, 72 insertions(+), 298 deletions(-) diff --git a/Makefile.in b/Makefile.in index e4d16a83..9a1df23 100755 --- a/Makefile.in +++ b/Makefile.in @@ -145,7 +145,7 @@ WISH = $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ -INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ @XFT_CFLAGS@ +INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ diff --git a/aclocal.m4 b/aclocal.m4 index b05bd59..6c7618b 100755 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -8,72 +8,3 @@ builtin(include,tclconfig/tcl.m4) # Add here whatever m4 macros you want to define for your package # -AC_DEFUN([XFT], [ - -if test "${TEA_WINDOWINGSYSTEM}" = "x11"; then - AC_MSG_CHECKING([whether to use xft]) - AC_ARG_ENABLE(xft, - AC_HELP_STRING([--enable-xft], - [use freetype/fontconfig/xft (default: on)]), - [enable_xft=$enableval], [enable_xft="default"]) - XFT_CFLAGS="" - XFT_LIBS="" - if test "$enable_xft" = "no" ; then - AC_MSG_RESULT([$enable_xft]) - else - found_xft="yes" - dnl make sure package configurator (xft-config or pkg-config - dnl says that xft is present. - XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" - XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" - if test "$found_xft" = "no" ; then - found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" - fi - AC_MSG_RESULT([$found_xft]) - dnl make sure that compiling against Xft header file doesn't bomb - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - AC_CHECK_HEADER(X11/Xft/Xft.h, [], [ - found_xft=no - ],[#include ]) - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - dnl make sure that linking against Xft libraries finds freetype - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - AC_CHECK_LIB(Xft, XftFontOpen, [], [ - found_xft=no - ]) - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - dnl print a warning if xft is unusable and was specifically requested - if test "$found_xft" = "no" ; then - if test "$enable_xft" = "yes" ; then - AC_MSG_WARN([Can't find xft configuration, or xft is unusable]) - fi - enable_xft=no - XFT_CFLAGS="" - XFT_LIBS="" - else - enable_xft=yes - fi - fi - if test $enable_xft = "yes" ; then - AC_DEFINE(HAVE_XFT, 1, [Have we turned on XFT (antialiased fonts)?]) - fi - AC_SUBST(XFT_CFLAGS) - AC_SUBST(XFT_LIBS) -fi - -]) - diff --git a/configure b/configure index f026ebc..adc813c 100755 --- a/configure +++ b/configure @@ -621,8 +621,6 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS TCLSH_PROG -XFT_LIBS -XFT_CFLAGS VC_MANIFEST_EMBED_EXE VC_MANIFEST_EMBED_DLL RANLIB_STUB @@ -759,7 +757,6 @@ enable_rpath enable_wince with_celib enable_symbols -enable_xft ' ac_precious_vars='build_alias host_alias @@ -1391,7 +1388,6 @@ Optional Features: --disable-rpath disable rpath support (default: on) --enable-wince enable Win/CE support (where applicable) --enable-symbols build with debugging symbols (default: off) - --enable-xft use freetype/fontconfig/xft (default: on) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -5563,7 +5559,6 @@ done bltSpline.c bltSwitch.c bltText.c - bltUnixFont.c bltUtil.c bltVecCmd.c bltVecMath.c @@ -9376,132 +9371,7 @@ rm -f conftest* # Check for freetype / fontconfig / Xft support. #-------------------------------------------------------------------- - - -if test "${TEA_WINDOWINGSYSTEM}" = "x11"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use xft" >&5 -$as_echo_n "checking whether to use xft... " >&6; } - # Check whether --enable-xft was given. -if test "${enable_xft+set}" = set; then : - enableval=$enable_xft; enable_xft=$enableval -else - enable_xft="default" -fi - - XFT_CFLAGS="" - XFT_LIBS="" - if test "$enable_xft" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xft" >&5 -$as_echo "$enable_xft" >&6; } - else - found_xft="yes" - XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" - XFT_LIBS=`xft-config --libs 2>/dev/null` || found_xft="no" - if test "$found_xft" = "no" ; then - found_xft=yes - XFT_CFLAGS=`pkg-config --cflags xft 2>/dev/null` || found_xft="no" - XFT_LIBS=`pkg-config --libs xft 2>/dev/null` || found_xft="no" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_xft" >&5 -$as_echo "$found_xft" >&6; } - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - ac_fn_c_check_header_compile "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "#include -" -if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : - -else - - found_xft=no - -fi - - - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - if test "$found_xft" = "yes" ; then - tk_oldCFlags=$CFLAGS - CFLAGS="$XINCLUDES $XFT_CFLAGS" - tk_oldLibs=$LIBS - LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 -$as_echo_n "checking for XftFontOpen in -lXft... " >&6; } -if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXft $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XftFontOpen (); -int -main () -{ -return XftFontOpen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_Xft_XftFontOpen=yes -else - ac_cv_lib_Xft_XftFontOpen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 -$as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } -if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBXFT 1 -_ACEOF - - LIBS="-lXft $LIBS" - -else - - found_xft=no - -fi - - CFLAGS=$tk_oldCFlags - LIBS=$tk_oldLibs - fi - if test "$found_xft" = "no" ; then - if test "$enable_xft" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find xft configuration, or xft is unusable" >&5 -$as_echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} - fi - enable_xft=no - XFT_CFLAGS="" - XFT_LIBS="" - else - enable_xft=yes - fi - fi - if test $enable_xft = "yes" ; then - -$as_echo "#define HAVE_XFT 1" >>confdefs.h - - fi - - -fi - - +XFT #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the diff --git a/configure.in b/configure.in index 040c411..a1b5667 100755 --- a/configure.in +++ b/configure.in @@ -102,7 +102,6 @@ TEA_ADD_SOURCES([ bltSpline.c bltSwitch.c bltText.c - bltUnixFont.c bltUtil.c bltVecCmd.c bltVecMath.c diff --git a/src/bltConfig.C b/src/bltConfig.C index e341145..a5b72a1 100644 --- a/src/bltConfig.C +++ b/src/bltConfig.C @@ -719,25 +719,6 @@ DoConfig( } break; - case BLT_CONFIG_FONT: - { - Blt_Font font; - - if (objIsEmpty) { - font = NULL; - } else { - font = Blt_AllocFontFromObj(interp, tkwin, objPtr); - if (font == NULL) { - return TCL_ERROR; - } - } - if (*(Blt_Font *)ptr != NULL) { - Blt_FreeFont(*(Blt_Font *)ptr); - } - *(Blt_Font *)ptr = font; - } - break; - case BLT_CONFIG_TK_FONT: { Tk_Font font; @@ -1162,12 +1143,6 @@ FormatConfigValue( case BLT_CONFIG_DOUBLE: return Tcl_NewDoubleObj(*(double *)ptr); - case BLT_CONFIG_FONT: - if (*(Blt_Font *)ptr != NULL) { - string = Blt_NameOfFont(*(Blt_Font *)ptr); - } - break; - case BLT_CONFIG_TK_FONT: if (*(Tk_Font *)ptr != NULL) { string = Tk_NameOfFont(*(Tk_Font *)ptr); @@ -1847,13 +1822,6 @@ Blt_FreeOptions( } break; - case BLT_CONFIG_FONT: - if (*((Blt_Font *) ptr) != None) { - Blt_FreeFont(*((Blt_Font *) ptr)); - *((Blt_Font *) ptr) = NULL; - } - break; - case BLT_CONFIG_TK_FONT: if (*((Tk_Font *) ptr) != None) { Tk_FreeFont(*((Tk_Font *) ptr)); diff --git a/src/bltGrAxis.C b/src/bltGrAxis.C index 4c6fc4e..8b43eda 100644 --- a/src/bltGrAxis.C +++ b/src/bltGrAxis.C @@ -268,7 +268,7 @@ static Blt_ConfigSpec configSpecs[] = {BLT_CONFIG_COLOR, "-limitscolor", "limitsColor", "Color", DEF_AXIS_FOREGROUND, Blt_Offset(Axis, limitsTextStyle.color), ALL_GRAPHS}, - {BLT_CONFIG_FONT, "-limitsfont", "limitsFont", "Font", DEF_AXIS_LIMITS_FONT, + {BLT_CONFIG_TK_FONT, "-limitsfont", "limitsFont", "Font", DEF_AXIS_LIMITS_FONT, Blt_Offset(Axis, limitsTextStyle.font), ALL_GRAPHS}, {BLT_CONFIG_CUSTOM, "-limitsformat", "limitsFormat", "LimitsFormat", (char *)NULL, Blt_Offset(Axis, limitsFormats), @@ -320,10 +320,10 @@ static Blt_ConfigSpec configSpecs[] = DEF_AXIS_SUBDIVISIONS, Blt_Offset(Axis, reqNumMinorTicks), ALL_GRAPHS}, {BLT_CONFIG_ANCHOR, "-tickanchor", "tickAnchor", "Anchor", DEF_AXIS_TICK_ANCHOR, Blt_Offset(Axis, reqTickAnchor), ALL_GRAPHS}, - {BLT_CONFIG_FONT, "-tickfont", "tickFont", "Font", + {BLT_CONFIG_TK_FONT, "-tickfont", "tickFont", "Font", DEF_AXIS_TICKFONT_GRAPH, Blt_Offset(Axis, tickFont), GRAPH | STRIPCHART}, - {BLT_CONFIG_FONT, "-tickfont", "tickFont", "Font", + {BLT_CONFIG_TK_FONT, "-tickfont", "tickFont", "Font", DEF_AXIS_TICKFONT_BARCHART, Blt_Offset(Axis, tickFont), BARCHART}, {BLT_CONFIG_PIXELS_NNEG, "-ticklength", "tickLength", "TickLength", DEF_AXIS_TICKLENGTH, Blt_Offset(Axis, tickLength), @@ -340,7 +340,7 @@ static Blt_ConfigSpec configSpecs[] = {BLT_CONFIG_COLOR, "-titlecolor", "titleColor", "Color", DEF_AXIS_FOREGROUND, Blt_Offset(Axis, titleColor), ALL_GRAPHS}, - {BLT_CONFIG_FONT, "-titlefont", "titleFont", "Font", DEF_AXIS_TITLE_FONT, + {BLT_CONFIG_TK_FONT, "-titlefont", "titleFont", "Font", DEF_AXIS_TITLE_FONT, Blt_Offset(Axis, titleFont), ALL_GRAPHS}, {BLT_CONFIG_CUSTOM, "-use", "use", "Use", (char *)NULL, 0, ALL_GRAPHS, &useOption}, @@ -1951,7 +1951,7 @@ ResetTextStyles(Axis *axisPtr) gcMask = (GCForeground | GCLineWidth | GCCapStyle); gcValues.foreground = axisPtr->tickColor->pixel; - gcValues.font = Blt_FontId(axisPtr->tickFont); + gcValues.font = Tk_FontId(axisPtr->tickFont); gcValues.line_width = LineWidth(axisPtr->lineWidth); gcValues.cap_style = CapProjecting; diff --git a/src/bltGrAxis.h b/src/bltGrAxis.h index 5ce46bb..972e275 100644 --- a/src/bltGrAxis.h +++ b/src/bltGrAxis.h @@ -286,7 +286,7 @@ typedef struct { int activeRelief; float tickAngle; - Blt_Font tickFont; + Tk_Font tickFont; Tk_Anchor tickAnchor; Tk_Anchor reqTickAnchor; XColor *tickColor; @@ -295,7 +295,7 @@ typedef struct { GC activeTickGC; double titleAngle; - Blt_Font titleFont; + Tk_Font titleFont; Tk_Anchor titleAnchor; Tk_Justify titleJustify; XColor *titleColor; diff --git a/src/bltGrElemBar.C b/src/bltGrElemBar.C index 3d9bf96..6648e00 100644 --- a/src/bltGrElemBar.C +++ b/src/bltGrElemBar.C @@ -288,7 +288,7 @@ static Blt_ConfigSpec barPenConfigSpecs[] = {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", DEF_PEN_VALUE_COLOR, Blt_Offset(BarPen, valueStyle.color), ALL_PENS}, - {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", + {BLT_CONFIG_TK_FONT, "-valuefont", "valueFont", "ValueFont", DEF_PEN_VALUE_FONT, Blt_Offset(BarPen, valueStyle.font), ALL_PENS}, {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", @@ -379,7 +379,7 @@ static Blt_ConfigSpec barElemConfigSpecs[] = { {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", DEF_PEN_VALUE_COLOR, Blt_Offset(BarElement, builtinPen.valueStyle.color), 0}, - {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", + {BLT_CONFIG_TK_FONT, "-valuefont", "valueFont", "ValueFont", DEF_PEN_VALUE_FONT, Blt_Offset(BarElement, builtinPen.valueStyle.font), 0}, {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index 83de015..c3f3edc 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -530,7 +530,7 @@ static Blt_ConfigSpec lineElemConfigSpecs[] = {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", DEF_PEN_VALUE_COLOR, Blt_Offset(LineElement, builtinPen.valueStyle.color), 0}, - {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", + {BLT_CONFIG_TK_FONT, "-valuefont", "valueFont", "ValueFont", DEF_PEN_VALUE_FONT, Blt_Offset(LineElement, builtinPen.valueStyle.font), 0}, {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", @@ -613,7 +613,7 @@ static Blt_ConfigSpec linePenConfigSpecs[] = DEF_PEN_VALUE_ANCHOR, Blt_Offset(LinePen, valueStyle.anchor), ALL_PENS}, {BLT_CONFIG_COLOR, "-valuecolor", "valueColor", "ValueColor", DEF_PEN_VALUE_COLOR, Blt_Offset(LinePen, valueStyle.color), ALL_PENS}, - {BLT_CONFIG_FONT, "-valuefont", "valueFont", "ValueFont", + {BLT_CONFIG_TK_FONT, "-valuefont", "valueFont", "ValueFont", DEF_PEN_VALUE_FONT, Blt_Offset(LinePen, valueStyle.font), ALL_PENS}, {BLT_CONFIG_STRING, "-valueformat", "valueFormat", "ValueFormat", DEF_PEN_VALUE_FORMAT, Blt_Offset(LinePen, valueFormat), diff --git a/src/bltGrLegd.C b/src/bltGrLegd.C index 1dc44f1..72bc807 100644 --- a/src/bltGrLegd.C +++ b/src/bltGrLegd.C @@ -287,7 +287,7 @@ static Blt_ConfigSpec configSpecs[] = {BLT_CONFIG_COLOR, "-focusforeground", "focusForeground", "FocusForeground", DEF_LEGEND_FOCUS_FG_MONO, Blt_Offset(Legend, focusColor), BLT_CONFIG_MONO_ONLY}, - {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_LEGEND_FONT, + {BLT_CONFIG_TK_FONT, "-font", "font", "Font", DEF_LEGEND_FONT, Blt_Offset(Legend, style.font), 0}, {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0}, {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", @@ -347,7 +347,7 @@ static Blt_ConfigSpec configSpecs[] = Blt_Offset(Legend, title), BLT_CONFIG_NULL_OK}, {BLT_CONFIG_COLOR, "-titlecolor", "titleColor", "Foreground", DEF_LEGEND_TITLECOLOR, Blt_Offset(Legend, titleStyle.color), 0}, - {BLT_CONFIG_FONT, "-titlefont", "titleFont", "Font", + {BLT_CONFIG_TK_FONT, "-titlefont", "titleFont", "Font", DEF_LEGEND_TITLEFONT, Blt_Offset(Legend, titleStyle.font), 0}, {BLT_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0} }; @@ -1108,7 +1108,7 @@ Blt_MapLegend( int lw, lh; int maxWidth, maxHeight; int symbolWidth; - Blt_FontMetrics fontMetrics; + Tk_FontMetrics fontMetrics; /* Initialize legend values to default (no legend displayed) */ legendPtr->entryWidth = legendPtr->entryHeight = 0; @@ -1155,7 +1155,7 @@ Blt_MapLegend( } - Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics); + Tk_GetFontMetrics(legendPtr->style.font, &fontMetrics); symbolWidth = 2 * fontMetrics.ascent; maxWidth += 2 * legendPtr->entryBW + PADDING(legendPtr->ixPad) + @@ -1269,7 +1269,7 @@ Blt_DrawLegend(Graph *graphPtr, Drawable drawable) { Blt_Background bg; Blt_ChainLink link; - Blt_FontMetrics fontMetrics; + Tk_FontMetrics fontMetrics; Legend *legendPtr = graphPtr->legend; Pixmap pixmap; Tk_Window tkwin; @@ -1325,7 +1325,7 @@ Blt_DrawLegend(Graph *graphPtr, Drawable drawable) w, h, 0, TK_RELIEF_FLAT); Blt_SetBackgroundOrigin(tkwin, graphPtr->normalBg, xOrigin, yOrigin); } - Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics); + Tk_GetFontMetrics(legendPtr->style.font, &fontMetrics); symbolSize = fontMetrics.ascent; xMid = symbolSize + 1 + legendPtr->entryBW; @@ -1462,7 +1462,7 @@ Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps) Blt_ChainLink link; int symbolSize, xMid, yMid; int width, height; - Blt_FontMetrics fontMetrics; + Tk_FontMetrics fontMetrics; if ((legendPtr->flags & HIDE) || (legendPtr->nEntries == 0)) { return; @@ -1493,7 +1493,7 @@ Blt_LegendToPostScript(Graph *graphPtr, Blt_Ps ps) Blt_Ps_SetClearBackground(ps); Blt_Ps_XFillRectangle(ps, x, y, width, height); } - Blt_GetFontMetrics(legendPtr->style.font, &fontMetrics); + Tk_GetFontMetrics(legendPtr->style.font, &fontMetrics); symbolSize = fontMetrics.ascent; xMid = symbolSize + 1 + legendPtr->entryBW; yMid = (symbolSize / 2) + 1 + legendPtr->entryBW; diff --git a/src/bltGrMarker.C b/src/bltGrMarker.C index 54b446a..c0d936a 100644 --- a/src/bltGrMarker.C +++ b/src/bltGrMarker.C @@ -677,7 +677,7 @@ static Blt_ConfigSpec textConfigSpecs[] = {BLT_CONFIG_SYNONYM, "-fg", "foreground", "Foreground", (char *)NULL, 0, 0}, {BLT_CONFIG_SYNONYM, "-fill", "background", (char *)NULL, (char *)NULL, 0, 0}, - {BLT_CONFIG_FONT, "-font", "font", "Font", DEF_MARKER_FONT, + {BLT_CONFIG_TK_FONT, "-font", "font", "Font", DEF_MARKER_FONT, Blt_Offset(TextMarker, style.font), 0}, {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", DEF_MARKER_FOREGROUND, Blt_Offset(TextMarker, style.color), 0}, diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C index a9a38a1..c3eafe7 100644 --- a/src/bltGrPSOutput.C +++ b/src/bltGrPSOutput.C @@ -45,6 +45,9 @@ #include "bltDBuffer.h" #include "bltPsInt.h" +#define FONT_ITALIC (1<<0) +#define FONT_BOLD (1<<1) + #define PS_MAXPATH 1500 /* Maximum number of components in a * PostScript (level 1) path. */ @@ -970,8 +973,9 @@ Blt_Ps_XSetStipple(Blt_Ps ps, Display *display, Pixmap bitmap) */ void -Blt_Ps_XSetFont(PostScript *psPtr, Blt_Font font) +Blt_Ps_XSetFont(PostScript *psPtr, Tk_Font font) { +#if 0 Tcl_Interp *interp = psPtr->interp; const char *family; @@ -980,7 +984,7 @@ Blt_Ps_XSetFont(PostScript *psPtr, Blt_Font font) char *value; value = (char *)Tcl_GetVar2(interp, psPtr->setupPtr->fontVarName, - Blt_NameOfFont(font), 0); + Tk_NameOfFont(font), 0); if (value != NULL) { const char **argv = NULL; int argc; @@ -1024,7 +1028,9 @@ Blt_Ps_XSetFont(PostScript *psPtr, Blt_Font font) return; } Blt_Ps_Append(psPtr, "12.0 /Helvetica-Bold SetFont\n"); +#endif } + #if 0 static void TextLayoutToPostScript(Blt_Ps ps, int x, int y, TextLayout *textPtr) diff --git a/src/bltGrPSOutput.h b/src/bltGrPSOutput.h index 0c02078..0c9f8f2 100644 --- a/src/bltGrPSOutput.h +++ b/src/bltGrPSOutput.h @@ -145,7 +145,7 @@ extern void Blt_Ps_XSetBitmapData(Blt_Ps ps, Display *display, extern void Blt_Ps_XSetForeground(Blt_Ps ps, XColor *colorPtr); -extern void Blt_Ps_XSetFont(Blt_Ps ps, Blt_Font font); +extern void Blt_Ps_XSetFont(Blt_Ps ps, Tk_Font font); extern void Blt_Ps_XSetDashes(Blt_Ps ps, Blt_Dashes *dashesPtr); @@ -203,9 +203,9 @@ extern void Blt_Ps_Polygon(Blt_Ps ps, Point2d *screenPts, int nScreenPts); extern void Blt_Ps_SetPrinting(Blt_Ps ps, int value); extern int Blt_Ps_IsPrinting(void); -extern int Blt_Ps_TextWidth(Blt_Font font, const char *string, int nBytes); +extern int Blt_Ps_TextWidth(Tk_Font font, const char *string, int nBytes); -extern int Blt_Ps_GetFontMetrics(Blt_Font font, Blt_FontMetrics *fmPtr); +extern int Blt_Ps_GetFontMetrics(Tk_Font font, Tk_FontMetrics *fmPtr); extern void Blt_Ps_FontName(const char *family, int flags, Tcl_DString *resultPtr); diff --git a/src/bltGrText.C b/src/bltGrText.C index 820df93..396df96 100644 --- a/src/bltGrText.C +++ b/src/bltGrText.C @@ -112,7 +112,7 @@ Blt_GetBitmapGC(Tk_Window tkwin) */ void Blt_GetTextExtents( - Blt_Font font, + Tk_Font font, int leader, const char *text, /* Text string to be measured. */ int textLen, /* Length of the text. If -1, indicates that @@ -127,9 +127,9 @@ Blt_GetTextExtents( return; /* NULL string? */ } { - Blt_FontMetrics fm; + Tk_FontMetrics fm; - Blt_GetFontMetrics(font, &fm); + Tk_GetFontMetrics(font, &fm); lineHeight = fm.linespace; } if (textLen < 0) { @@ -148,7 +148,7 @@ Blt_GetTextExtents( if (lineLen > 0) { unsigned int lineWidth; - lineWidth = Blt_TextWidth(font, line, lineLen); + lineWidth = Tk_TextWidth(font, line, lineLen); if (lineWidth > maxWidth) { maxWidth = lineWidth; } @@ -165,7 +165,7 @@ Blt_GetTextExtents( unsigned int lineWidth; maxHeight += lineHeight; - lineWidth = Blt_TextWidth(font, line, lineLen); + lineWidth = Tk_TextWidth(font, line, lineLen); if (lineWidth > maxWidth) { maxWidth = lineWidth; } @@ -503,10 +503,10 @@ Blt_Ts_DrawText( Display* display = Tk_Display(tkwin); - Tk_Font font = Tk_GetFont(stylePtr->font->interp,tkwin,"Helvetica 10 normal roman"); - GC gc = XCreateGC(display, Tk_WindowId(tkwin), 0, NULL); - XSetFont(display, gc, Tk_FontId(font)); - // Tk_Font font = stylePtr->font; + // Tk_Font font = Tk_GetFont(stylePtr->font->interp,tkwin,"Helvetica 10 normal roman"); + // GC gc = XCreateGC(display, Tk_WindowId(tkwin), 0, NULL); + // XSetFont(display, gc, Tk_FontId(font)); + Tk_Font font = stylePtr->font; // GC gc = stylePtr->gc; int width,height, xx, yy; @@ -515,14 +515,14 @@ Blt_Ts_DrawText( &width, &height); Blt_TranslateAnchor(x, y, width, height, stylePtr->anchor, &xx, &yy); // printf("x=%d y=%d, xx=%d yy=%d\n",x,y,xx,yy); - TkDrawAngledTextLayout(display, drawable, gc, layout, xx, yy, - stylePtr->angle, 0, textLen); + // TkDrawAngledTextLayout(display, drawable, gc, layout, xx, yy, + // stylePtr->angle, 0, textLen); - if (gc) - XFreeGC(display, gc); + // if (gc) + // XFreeGC(display, gc); - if (font) - Tk_FreeFont(font); + // if (font) + // Tk_FreeFont(font); } void @@ -543,10 +543,10 @@ Blt_DrawText2( Display* display = Tk_Display(tkwin); - Tk_Font font = Tk_GetFont(stylePtr->font->interp,tkwin,"Helvetica 10 normal roman"); - GC gc = XCreateGC(display, Tk_WindowId(tkwin), 0, NULL); - XSetFont(display, gc, Tk_FontId(font)); - // Tk_Font font = stylePtr->font; + // Tk_Font font = Tk_GetFont(stylePtr->font->interp,tkwin,"Helvetica 10 normal roman"); + // GC gc = XCreateGC(display, Tk_WindowId(tkwin), 0, NULL); + // XSetFont(display, gc, Tk_FontId(font)); + Tk_Font font = stylePtr->font; // GC gc = stylePtr->gc; int width,height, xx, yy; @@ -554,14 +554,14 @@ Blt_DrawText2( stylePtr->justify, 0, &width, &height); Blt_TranslateAnchor(x, y, width, height, stylePtr->anchor, &xx, &yy); - TkDrawAngledTextLayout(display, drawable, gc, layout, xx, yy, - stylePtr->angle, 0, -1); + // TkDrawAngledTextLayout(display, drawable, gc, layout, xx, yy, + // stylePtr->angle, 0, -1); - if (gc) - XFreeGC(display, gc); + // if (gc) + // XFreeGC(display, gc); - if (font) - Tk_FreeFont(font); + // if (font) + // Tk_FreeFont(font); float angle = fmod(stylePtr->angle, 360.0); if (angle < 0.0) { @@ -599,10 +599,10 @@ Blt_DrawText( Display* display = Tk_Display(tkwin); - Tk_Font font = Tk_GetFont(stylePtr->font->interp,tkwin,"Helvetica 10 normal roman"); - GC gc = XCreateGC(display, Tk_WindowId(tkwin), 0, NULL); - XSetFont(display, gc, Tk_FontId(font)); - // Tk_Font font = stylePtr->font; + // Tk_Font font = Tk_GetFont(stylePtr->font->interp,tkwin,"Helvetica 10 normal roman"); + // GC gc = XCreateGC(display, Tk_WindowId(tkwin), 0, NULL); + // XSetFont(display, gc, Tk_FontId(font)); + Tk_Font font = stylePtr->font; // GC gc = stylePtr->gc; int width,height, xx, yy; @@ -610,14 +610,14 @@ Blt_DrawText( stylePtr->justify, 0, &width, &height); Blt_TranslateAnchor(x, y, width, height, stylePtr->anchor, &xx, &yy); - TkDrawAngledTextLayout(display, drawable, gc, layout, xx, yy, - stylePtr->angle, 0, -1); + // TkDrawAngledTextLayout(display, drawable, gc, layout, xx, yy, + // stylePtr->angle, 0, -1); - if (gc) - XFreeGC(display, gc); + // if (gc) + // XFreeGC(display, gc); - if (font) - Tk_FreeFont(font); + // if (font) + // Tk_FreeFont(font); } void @@ -628,7 +628,7 @@ Blt_Ts_ResetStyle(Tk_Window tkwin, TextStyle *stylePtr) unsigned long gcMask; gcMask = GCFont; - gcValues.font = Blt_FontId(stylePtr->font); + gcValues.font = Tk_FontId(stylePtr->font); if (stylePtr->color != NULL) { gcMask |= GCForeground; gcValues.foreground = stylePtr->color->pixel; diff --git a/src/bltGrText.h b/src/bltGrText.h index 267e502..71f2b4c 100644 --- a/src/bltGrText.h +++ b/src/bltGrText.h @@ -51,7 +51,7 @@ typedef struct { unsigned int state; /* If non-zero, indicates to draw text * in the active color */ XColor *color; /* Color to draw the text. */ - Blt_Font font; /* Font to use to draw text */ + Tk_Font font; /* Font to use to draw text */ Blt_Background bg; /* Background color of text. This is * also used for drawing disabled * text. */ @@ -74,7 +74,7 @@ typedef struct { GC gc; /* GC used to draw the text */ } TextStyle; -extern void Blt_GetTextExtents(Blt_Font font, int leader, const char *text, +extern void Blt_GetTextExtents(Tk_Font font, int leader, const char *text, int textLen, unsigned int *widthPtr, unsigned int *heightPtr); extern void Blt_Ts_GetExtents(TextStyle *tsPtr, const char *text, diff --git a/src/bltGraph.C b/src/bltGraph.C index 5dae8c4..14bf77b 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -164,7 +164,7 @@ static Blt_ConfigSpec configSpecs[] = {BLT_CONFIG_STRING, "-datacommand", "dataCommand", "DataCommand", (char *)NULL, Blt_Offset(Graph, dataCmd), BLT_CONFIG_DONT_SET_DEFAULT}, {BLT_CONFIG_SYNONYM, "-fg", "foreground", (char *)NULL, (char *)NULL, 0, 0}, - {BLT_CONFIG_FONT, "-font", "font", "Font", + {BLT_CONFIG_TK_FONT, "-font", "font", "Font", DEF_GRAPH_FONT, Blt_Offset(Graph, titleTextStyle.font), 0}, {BLT_CONFIG_COLOR, "-foreground", "foreground", "Foreground", DEF_GRAPH_TITLE_COLOR, Blt_Offset(Graph, titleTextStyle.color), 0}, -- cgit v0.12