Check for FreeType using freetype-config, since we can't rely on Xft to
Tue Dec 19 23:47:27 2000 Owen Taylor <otaylor@redhat.com> * configure.in gdk/x11/Makefile.am: Check for FreeType using freetype-config, since we can't rely on Xft to pull in the libraries for us, or rely on it being in the default include path first. * gtk/gtkframe.c: Fix some problems where the gap wasn't being drawn in the right place, especially for right-aligned frame labels. Thu Dec 14 21:02:59 2000 Owen Taylor <otaylor@redhat.com> * gtk/gtkfontsel.c (gtk_font_selection_select_font): Update the font_name entry as needed.
This commit is contained in:
34
configure.in
34
configure.in
@ -398,20 +398,40 @@ if test "x$gdktarget" = "xx11"; then
|
|||||||
,
|
,
|
||||||
$x_libs)
|
$x_libs)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Checks for FreeType
|
||||||
|
#
|
||||||
|
FREETYPE_LIBS=
|
||||||
|
FREETYPE_CFLAGS=
|
||||||
|
have_freetype=false
|
||||||
|
AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
|
||||||
|
if test "x$FREE_CONFIG" != "xno" ; then
|
||||||
|
FREETYPE_CFLAGS=`freetype-config --cflags`
|
||||||
|
FREETYPE_LIBS=`freetype-config --libs`
|
||||||
|
|
||||||
|
AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
|
||||||
|
,:,$FREETYPE_LIBS)
|
||||||
|
fi
|
||||||
|
AC_SUBST(FREETYPE_CFLAGS)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Checks for Xft/XRender
|
# Checks for Xft/XRender
|
||||||
#
|
#
|
||||||
have_xft=false
|
have_xft=false
|
||||||
XFT_LIBS=""
|
XFT_LIBS=""
|
||||||
AC_CHECK_LIB(Xrender, XRenderFindFormat,
|
XFT_CFLAGS=""
|
||||||
AC_CHECK_LIB(Xft, XftFontOpen, have_xft=true, :, -lXrender $X_LIBS)
|
if test $have_freetype = true ; then
|
||||||
,:,-lXext $X_LIBS)
|
AC_CHECK_LIB(Xrender, XRenderFindFormat,
|
||||||
|
AC_CHECK_LIB(Xft, XftFontOpen, have_xft=true, :, -lXrender -lXext $X_LIBS $FREETYPE_LIBS)
|
||||||
|
,:,-lXext $X_LIBS)
|
||||||
|
|
||||||
if $have_xft = 'true' ; then
|
if $have_xft = 'true' ; then
|
||||||
X_LIBS="-lXft -lXrender -lXext $X_LIBS"
|
X_LIBS="-lXft -lXrender -lXext $FREETYPE_LIBS $X_LIBS"
|
||||||
AC_DEFINE(HAVE_XFT)
|
AC_DEFINE(HAVE_XFT)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(XFT_LIBS)
|
||||||
AM_CONDITIONAL(HAVE_XFT, $have_xft)
|
AM_CONDITIONAL(HAVE_XFT, $have_xft)
|
||||||
|
|
||||||
# Check for XIM support.
|
# Check for XIM support.
|
||||||
|
|||||||
@ -13,6 +13,7 @@ INCLUDES = @STRIP_BEGIN@ \
|
|||||||
@GTK_LOCALE_FLAGS@ \
|
@GTK_LOCALE_FLAGS@ \
|
||||||
@PANGO_CFLAGS@ \
|
@PANGO_CFLAGS@ \
|
||||||
@GLIB_CFLAGS@ \
|
@GLIB_CFLAGS@ \
|
||||||
|
@FREETYPE_CFLAGS@ \
|
||||||
@x_cflags@ \
|
@x_cflags@ \
|
||||||
@STRIP_END@
|
@STRIP_END@
|
||||||
|
|
||||||
|
|||||||
@ -429,6 +429,8 @@ gtk_font_selection_select_font (GtkWidget *w,
|
|||||||
{
|
{
|
||||||
g_free (fontsel->font_desc->family_name);
|
g_free (fontsel->font_desc->family_name);
|
||||||
fontsel->font_desc->family_name = g_strdup (family_name);
|
fontsel->font_desc->family_name = g_strdup (family_name);
|
||||||
|
|
||||||
|
gtk_entry_set_text (fontsel->font_entry, family_name);
|
||||||
|
|
||||||
gtk_font_selection_show_available_styles (fontsel);
|
gtk_font_selection_show_available_styles (fontsel);
|
||||||
gtk_font_selection_select_best_style (fontsel, TRUE);
|
gtk_font_selection_select_best_style (fontsel, TRUE);
|
||||||
|
|||||||
@ -28,6 +28,9 @@
|
|||||||
#include "gtkframe.h"
|
#include "gtkframe.h"
|
||||||
#include "gtklabel.h"
|
#include "gtklabel.h"
|
||||||
|
|
||||||
|
#define LABEL_PAD 1
|
||||||
|
#define LABEL_SIDE_PAD 2
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ARG_0,
|
ARG_0,
|
||||||
ARG_LABEL,
|
ARG_LABEL,
|
||||||
@ -400,14 +403,14 @@ gtk_frame_paint (GtkWidget *widget,
|
|||||||
y -= height_extra * (1 - frame->label_yalign);
|
y -= height_extra * (1 - frame->label_yalign);
|
||||||
height += height_extra * (1 - frame->label_yalign);
|
height += height_extra * (1 - frame->label_yalign);
|
||||||
|
|
||||||
x2 = 2 + (frame->child_allocation.width - child_requisition.width) * xalign;
|
x2 = widget->style->xthickness + (frame->child_allocation.width - child_requisition.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
|
||||||
|
|
||||||
gtk_paint_shadow_gap (widget->style, widget->window,
|
gtk_paint_shadow_gap (widget->style, widget->window,
|
||||||
GTK_STATE_NORMAL, frame->shadow_type,
|
GTK_STATE_NORMAL, frame->shadow_type,
|
||||||
area, widget, "frame",
|
area, widget, "frame",
|
||||||
x, y, width, height,
|
x, y, width, height,
|
||||||
GTK_POS_TOP,
|
GTK_POS_TOP,
|
||||||
x2, child_requisition.width - 4);
|
x2, child_requisition.width + 2 * LABEL_PAD);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gtk_paint_shadow (widget->style, widget->window,
|
gtk_paint_shadow (widget->style, widget->window,
|
||||||
@ -459,7 +462,7 @@ gtk_frame_size_request (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
gtk_widget_size_request (frame->label_widget, &child_requisition);
|
gtk_widget_size_request (frame->label_widget, &child_requisition);
|
||||||
|
|
||||||
requisition->width = child_requisition.width;
|
requisition->width = child_requisition.width + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
|
||||||
requisition->height =
|
requisition->height =
|
||||||
MAX (0, child_requisition.height - GTK_WIDGET (widget)->style->xthickness);
|
MAX (0, child_requisition.height - GTK_WIDGET (widget)->style->xthickness);
|
||||||
}
|
}
|
||||||
@ -523,8 +526,8 @@ gtk_frame_size_allocate (GtkWidget *widget,
|
|||||||
else
|
else
|
||||||
xalign = 1 - frame->label_xalign;
|
xalign = 1 - frame->label_xalign;
|
||||||
|
|
||||||
child_allocation.x = frame->child_allocation.x +
|
child_allocation.x = frame->child_allocation.x + LABEL_SIDE_PAD +
|
||||||
(frame->child_allocation.width - child_requisition.width) * xalign;
|
(frame->child_allocation.width - child_requisition.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_PAD;
|
||||||
child_allocation.width = child_requisition.width;
|
child_allocation.width = child_requisition.width;
|
||||||
|
|
||||||
child_allocation.y = frame->child_allocation.y - child_requisition.height;
|
child_allocation.y = frame->child_allocation.y - child_requisition.height;
|
||||||
|
|||||||
Reference in New Issue
Block a user