text:
La Abogacía General del Estado de España es el órgano administrativo de la Administración General del Estado, integrado en el Ministerio de Justicia, responsable de dirigir los servicios que prestan asistencia jurídica al Estado y a otras instituciones públicas. El titular de la Abogacía General, con nivel orgánico de subsecretario, dirige el Servicio Jurídico del Estado, formado por funcionarios del Cuerpo de Abogados del Estado.

El abogado general del Estado es nombrado por el rey de España a propuesta del ministro de Justicia, previa deliberación del Consejo de Ministros. Para ser nombrado abogado general hay que ser de antemano abogado del Estado. En los casos de vacante, ausencia o enfermedad, el ministro de Justicia es responsable de decidir quién lo suple; de no hacerlo, la ley establece que lo harán los directores generales por el orden establecido en el Reglamento de la Abogacía General del Estado. Desde junio de 2018 la abogada general del Estado es Consuelo Castro.

Historia
La Abogacía General del Estado ha recibido muchos nombres desde su creación. En 1849, año de su creación, recibió la denominación de Dirección General de lo Contencioso. En origen estaba integrada en el Ministerio de Hacienda, pues es heredera de aquellos asesores jurídicos que prestaban sus servicios en ese departamento y en el Tesoro Público. Mantuvo esta denominación hasta 1854, cuando empezó a ser llamada Asesoría General del Ministerio de Hacienda pero, en 1877, volvió a recuperar su denominación tradicional, llamándose Dirección General de lo Contencioso del Estado.

Desde sus inicios en el Ministerio de Hacienda, se exigía que sus miembros fueran «letrados, versados en la ciencia administrativa, en la legislación y en la práctica de los negocios de los diversos ramos de la Hacienda pública». Sus funciones se limitaban al ámbito de este Ministerio y era responsable de emitir informes jurídicos y supervisar las acciones de los abogados ante los tribunales para defender los intereses del Tesoro Real.

En 1881 se crea el Cuerpo de Abogados del Estado.

A partir de 1985, se llamó Dirección General del Servicio Jurídico del Estado y se transfirió al Ministerio de Justicia, departamento que asumió las competencias en materia de asesoramiento legal a la Administración. Desde el año 2000, se hace oficial la denominación de Abogacía General del Estado-Dirección del Servicio Jurídico del Estado o, de forma simplificada, Abogacía General del Estado.

A finales de 2022, esta simplificación se hizo oficial con la aprobación de un nuevo real decreto que reemplazó de forma definitiva los términos «Dirección del Servicio Jurídico del Estado» y «Abogacía General del Estado-Dirección del Servicio Jurídico del Estado» por «Abogacía General del Estado».

Funciones
En concreto, a la Abogacía General del Estado le compete:

 El asesoramiento jurídico a la Administración General del Estado y a sus organismos autónomos, así como, cuando proceda normativa o convencionalmente, a las demás entidades que integran el sector público institucional estatal.
 El asesoramiento, cuando lo solicite el Gobierno o cualquiera de sus miembros, sobre la constitucionalidad de los anteproyectos y proyectos de disposiciones generales de cualquier rango que hayan de someterse a la aprobación de aquél o sobre las disposiciones generales o resoluciones de las comunidades autónomas que sean susceptibles de impugnación ante el Tribunal Constitucional.
 El informe en derecho de los anteproyectos de ley y proyectos de disposiciones generales cuando sean sometidos a su consulta, o cuando afecten o puedan afectar a la Abogacía General del Estado, su organización, funcionamiento y régimen de actuaciones.
 La formulación de recomendaciones sobre la aprobación o modificación de disposiciones normativas o sobre la adopción de otras medidas, así como la elaboración de los anteproyectos normativos que le sean encargados o que promueva.
 La representación y defensa de la Administración General del Estado, de sus organismos autónomos y de los órganos constitucionales así como, cuando proceda normativa o convencionalmente, de las demás entidades que integran el sector público institucional estatal ante cualesquiera jurisdicciones y órdenes jurisdiccionales.
 La representación y defensa, en los procedimientos seguidos ante el Tribunal Constitucional, de la Administración General del Estado, de sus organismos autónomos y de los órganos constitucionales, así como, cuando proceda, normativa o convencionalmente, de las demás entidades que integran el sector público institucional estatal.
 La representación y defensa del Reino de España ante el Tribunal Europeo de Derechos Humanos, así como el estudio y presentación de informes o memorias ante los distintos órganos del Consejo de Europa, en particular ante el departamento de ejecución de sentencias del Comité de Ministros del Consejo de Europa en relación con la ejecución de las sentencias del mencionado Tribunal.
 La representación y defensa del Reino de España ante cualesquiera órganos internacionales con competencias en materia de salvaguarda de los derechos humanos, de conformidad con lo establecido en los tratados internacionales suscritos por el Reino de España.
 La asistencia jurídica en materia de Derecho de la Unión Europea y la representación y defensa del Reino de España ante los órganos jurisdiccionales de la Unión Europea.
 La representación y defensa del Reino de España ante la Corte Penal Internacional y ante cualesquiera tribunales, órganos y organismos internacionales o supranacionales, o constituidos en virtud de tratados internacionales en los que aquél sea parte, en cualesquiera procedimientos jurisdiccionales, arbitrales o extrajudiciales.
 El asesoramiento, así como la representación y defensa en juicio de las comunidades autónomas, de las corporaciones locales y de las entidades que integran el sector público institucional autonómico y local, ante cualesquiera jurisdicciones y órdenes jurisdiccionales, cuando se haya celebrado convenio de asistencia jurídica con ese objeto.
 Cualquier actuación relacionada con la representación y defensa de la Administración General del Estado, de los órganos constitucionales y, en su caso, de las comunidades autónomas, de las corporaciones locales y de las entidades que integran el sector público institucional estatal, autonómico y local, cuando así corresponda normativa o convencionalmente, ante cualesquiera jurisdicciones o procedimientos prejudiciales, judiciales, arbitrales o extrajudiciales en el extranjero.
 El informe de los expedientes que se incoen para declarar lesivos a los intereses públicos los actos de la Administración General del Estado, de sus organismos autónomos o de las demás entidades del sector público institucional estatal a las que preste asistencia jurídica la Abogacía General del Estado, a efectos de la interposición, en su caso, del correspondiente recurso contencioso-administrativo, así como de los expedientes para el pago de costas a que fueran condenadas las mismas entidades, cuando se suscite controversia.
 El mantenimiento del principio de unidad de doctrina, formulando criterios generales de asistencia jurídica para los órganos y unidades que integran la Abogacía General del Estado, los Abogados del Estado, las personas habilitadas como sustitutos de los mismos y el restante personal de aquélla.
 El establecimiento de los criterios de actuación a seguir por los Abogados del Estado y el restante personal de la Abogacía General del Estado, derivados de los principios deontológicos vinculados al ejercicio de la abogacía, y, en su caso, de la procura, así como la resolución de las dudas que puedan suscitarse sobre la aplicación de estos principios deontológicos.
 La promoción de trabajos de investigación y la organización de actividades que tengan por finalidad el conocimiento y difusión de materias y cuestiones jurídicas de ámbito nacional o internacional, así como la organización de actividades de formación y perfeccionamiento del personal de la Abogacía General del Estado, en coordinación, en su caso, con el Centro de Estudios Jurídicos, el Instituto Nacional de Administración Pública y otros centros de formación.
 La gestión económica, financiera y presupuestaria de la Abogacía General del Estado, así como la administración y gestión del Cuerpo de Abogados del Estado y cualesquiera otras funciones dentro del ámbito económico-financiero y de personal que no estén atribuidas a otros órganos superiores por el ordenamiento jurídico.
 La propuesta de resolución de los procedimientos para la provisión de puestos de trabajo de la Abogacía General del Estado, reservados a funcionarios pertenecientes al Cuerpo de Abogados del Estado.
 La inspección de los órganos y unidades que integran la Abogacía General del Estado y, en su caso, el ejercicio de la potestad disciplinaria.
 El ejercicio de las restantes funciones que le atribuya el ordenamiento jurídico.

Estructura
Dependen de la Abogacía General del Estado-Dirección del Servicio Jurídico del Estado los siguientes órganos:
 La Dirección General de lo Consultivo, que dirige y establece los criterios generales para las unidades responsables del asesoramiento a los distintos órganos y organismos de la Administración, así como presta asesoramiento directo a los órganos centrales de la Administración General del Estado y, en su caso, a las entidades del sector público institucional estatal que tuvieran su sede en la Comunidad Autónoma de Madrid.
 La Dirección General de lo Contencioso, que dirige y establece los criterios generales de las unidades responsables de la representación y defensa en juicio de la Administración, así como representarla directamente cuando los procedimientos se lleven a cabo en la Comunidad Autónoma de Madrid o le fueren encomendados por resolución del Abogado General del Estado.
 La Dirección Adjunta de Medios Personales y Materiales de la Abogacía General del Estado, responsable de las políticas de recursos humanos, materiales y económicos de la Abogacía General.
 La Subdirección General de Asuntos Constitucionales y Derechos Humanos, responsable de la representación y defensa del Estado y de sus organismos y demás entidades públicas ante el Tribunal Constitucional y Tribunal Europeo de Derechos Humanos; del mismo modo, presta asesoramiento sobre todo tipo de cuestiones procesales o de fondo, de anteproyectos y proyectos de disposiciones de cualquier rango, e informes, observaciones y memorias que corresponda en los procedimientos ante los mencionados tribunales.
 La Subdirección General de Asuntos de la Unión Europea e Internacionales, responsable de la dirección jurídica y la representación y defensa del Reino de España ante los órganos jurisdiccionales de la Unión Europea, y ante la Corte Penal Internacional. Asimismo, le corresponde la asistencia jurídica en materia de Derecho de la Unión Europea, prestando especial asistencia a la Representación Permanente de España ante la Unión Europea.
 La Subdirección General de Auditoría Interna y Gestión del Conocimiento, a la que corresponde la coordinación de las relaciones entre las Abogacías del Estado que desempeñen funciones consultivas y las Abogacías del Estado que desempeñen funciones contenciosas; la dirección y coordinación de las relaciones con las entidades a las que el Servicio Jurídico del Estado preste asistencia jurídica en virtud de convenio; la dirección, coordinación y gestión económica de las costas procesales a favor del Estado, así como las demás funciones de coordinación que el titular de la Dirección del Servicio Jurídico del Estado le encomiende, y la función de inspección o auditoría de la Abogacía General del Estado y sus unidades y Abogados del Estado dependientes.
 El Gabinete Técnico del Abogado o Abogada General del Estado, que presta apoyo y auxilio al abogado general en sus funciones.
 Las Abogacías del Estado en las comunidades y ciudades autónomas, que prestan asesoramiento, representación y defensa a los órganos de la Administración General del Estado que ejerzan funciones en dichos ámbitos territoriales.
Se integran también en la Abogacía General del Estado los órganos y unidades dependientes de los órganos enumerados anteriormente. Asimismo, existe un Comité de Dirección y un Comité de Coordinación Territorial como órganos de apoyo al Abogado General del Estado.

Referencias

Enlaces externos
 Página web oficial

Ministerio de Justicia de España
Abogados Generales del Estado
Subsecretarías de España
Consejeros natos de Estado de España


text:
/********************************************/
/* gd interface to freetype library         */
/*                                          */
/* John Ellson   ellson@graphviz.org        */
/********************************************/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "gd.h"
#include "gdhelpers.h"
#include "entities.h"

/* 2.0.10: WIN32, not MSWIN32 */
#if !defined(WIN32) && !defined(_WIN32_WCE)
#include <unistd.h>
#elif defined(_WIN32_WCE)
#include <wce_stdlib.h> /* getenv() */
#include <wce_unistd.h> /* access() */
#define getenv wceex_getenv
#define access wceex_access
#define strdup _strdup
#else /* _WIN32_WCE */
#include <io.h>
#ifndef R_OK
#define R_OK 04			/* Needed in Windows */
#endif
#endif

/* number of antialised colors for indexed bitmaps */
#define GD_NUMCOLORS 8

static int fontConfigFlag = 0;

static char *font_path(char **fontpath, char *name_list);
/* translate a fontconfig fontpattern into a fontpath.
	return NULL if OK, else return error string */
static char *font_pattern(char **fontpath, char *fontpattern);

/* 2.0.30: move these up here so we can build correctly without freetype
	but with fontconfig */

/*
 * The character (space) used to separate alternate fonts in the
 * fontlist parameter to gdImageStringFT. 2.0.18: space was a
 * poor choice for this.
 */
#define LISTSEPARATOR ";"

/*
 * DEFAULT_FONTPATH and PATHSEPARATOR are host type dependent and
 * are normally set by configure in config.h.  These are just
 * some last resort values that might match some Un*x system
 * if building this version of gd separate from graphviz.
 */
#ifndef DEFAULT_FONTPATH
#if defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh))
#define DEFAULT_FONTPATH "/usr/share/fonts/truetype:/System/Library/Fonts:/Library/Fonts"
#else
#define DEFAULT_FONTPATH "/usr/share/fonts/truetype"
#endif
#endif
#ifndef PATHSEPARATOR
#define PATHSEPARATOR ":"
#endif

#ifndef TRUE
#define FALSE 0
#define TRUE !FALSE
#endif

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

BGD_DECLARE(char *) gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist,
		  double ptsize, double angle, int x, int y, char *string)
{
  /* 2.0.6: valid return */
  return gdImageStringFT (im, brect, fg, fontlist, ptsize,
			  angle, x, y, string);
}

#ifndef HAVE_LIBFREETYPE
BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
		   double ptsize, double angle, int x, int y, char *string,
		   gdFTStringExtraPtr strex)
{
  return "libgd was not built with FreeType font support\n";
}

BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
		 double ptsize, double angle, int x, int y, char *string)
{
  return "libgd was not built with FreeType font support\n";
}
#else

#ifndef HAVE_LIBFONTCONFIG
static char * font_pattern(char **fontpath, char *fontpattern)
{
  return "libgd was not built with FontConfig support\n";
}
#endif /* HAVE_LIBFONTCONFIG */

#include "gdcache.h"
/* 2.0.16 Christophe Thomas: starting with FreeType 2.1.6, this is
  mandatory, and it has been supported for a long while. */
#ifdef HAVE_FT2BUILD_H
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include FT_SIZES_H
#else
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
#include <freetype/ftsizes.h>
#endif

/* number of fonts cached before least recently used is replaced */
#define FONTCACHESIZE 6

/* number of antialias color lookups cached */
#define TWEENCOLORCACHESIZE 32

/*
 * Line separation as a factor of font height.
 *      No space between if LINESPACE = 1.00
 *      Line separation will be rounded up to next pixel row.
 */
#define LINESPACE 1.05

typedef struct
{
  char *fontlist;		/* key */
  int flags;			/* key */
  char *fontpath;
  FT_Library *library;
  FT_Face face;
}
font_t;

typedef struct
{
  char *fontlist;		/* key */
  int flags;			/* key */
  FT_Library *library;
}
fontkey_t;

typedef struct
{
  int pixel;			/* key */
  int bgcolor;			/* key */
  int fgcolor;			/* key *//* -ve means no antialias */
  gdImagePtr im;		/* key */
  int tweencolor;
}
tweencolor_t;

typedef struct
{
  int pixel;			/* key */
  int bgcolor;			/* key */
  int fgcolor;			/* key *//* -ve means no antialias */
  gdImagePtr im;		/* key */
}
tweencolorkey_t;

/********************************************************************
 * gdTcl_UtfToUniChar is borrowed from Tcl ...
 */
/*
 * tclUtf.c --
 *
 *      Routines for manipulating UTF-8 strings.
 *
 * Copyright (c) 1997-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * SCCS: @(#) tclUtf.c 1.25 98/01/28 18:02:43
 */

/*
 *---------------------------------------------------------------------------
 *
 * gdTcl_UtfToUniChar --
 *
 *      Extract the Tcl_UniChar represented by the UTF-8 string.  Bad
 *      UTF-8 sequences are converted to valid Tcl_UniChars and processing
 *      continues.  Equivalent to Plan 9 chartorune().
 *
 *      The caller must ensure that the source buffer is long enough that
 *      this routine does not run off the end and dereference non-existent
 *      memory looking for trail bytes.  If the source buffer is known to
 *      be '\0' terminated, this cannot happen.  Otherwise, the caller
 *      should call Tcl_UtfCharComplete() before calling this routine to
 *      ensure that enough bytes remain in the string.
 *
 * Results:
 *      *chPtr is filled with the Tcl_UniChar, and the return value is the
 *      number of bytes from the UTF-8 string that were consumed.
 *
 * Side effects:
 *      None.
 *
 *---------------------------------------------------------------------------
 */

#ifdef JISX0208
#include "jisx0208.h"
#endif

static int comp_entities(const void *e1, const void *e2) {
  struct entities_s *en1 = (struct entities_s *) e1;
  struct entities_s *en2 = (struct entities_s *) e2;
  return strcmp(en1->name, en2->name);
}

extern int any2eucjp (char *, char *, unsigned int);

/* Persistent font cache until explicitly cleared */
/* Fonts can be used across multiple images */

/* 2.0.16: thread safety (the font cache is shared) */
gdMutexDeclare (gdFontCacheMutex);
static gdCache_head_t *fontCache;
static FT_Library library;

#define Tcl_UniChar int
#define TCL_UTF_MAX 3
static int
gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr)
/* str is the UTF8 next character pointer */
/* chPtr is the int for the result */
{
  int byte;
  char entity_name_buf[ENTITY_NAME_LENGTH_MAX+1];
  char *p;
  struct entities_s key, *res;

  /* HTML4.0 entities in decimal form, e.g. Å */
  /*           or in hexadecimal form, e.g. 水 */
  byte = *((unsigned char *) str);
  if (byte == '&')
    {
      int i, n = 0;

      byte = *((unsigned char *) (str + 1));
      if (byte == '#')
	{
          byte = *((unsigned char *) (str + 2));
          if (byte == 'x' || byte == 'X')
            {
              for (i = 3; i < 8; i++)
                {
                  byte = *((unsigned char *) (str + i));
                  if (byte >= 'A' && byte <= 'F')
                    byte = byte - 'A' + 10;
                  else if (byte >= 'a' && byte <= 'f')
                    byte = byte - 'a' + 10;
                  else if (byte >= '0' && byte <= '9')
                    byte = byte - '0';
                  else
                    break;
                  n = (n * 16) + byte;
                }
            }
          else
            {
	      for (i = 2; i < 8; i++)
	        {
	          byte = *((unsigned char *) (str + i));
	          if (byte >= '0' && byte <= '9')
	            n = (n * 10) + (byte - '0');
	          else
		    break;
		}
	    }
	  if (byte == ';')
	    {
	      *chPtr = (Tcl_UniChar) n;
	      return ++i;
	    }
	}
      else
        {
          key.name = p = entity_name_buf;
          for (i = 1; i <= 1 + ENTITY_NAME_LENGTH_MAX; i++)
            {
              byte = *((unsigned char *) (str + i));
              if (byte == '\0')
                break;
              if (byte == ';')
                {
                  *p++ = '\0';
                  res = bsearch(&key, entities, NR_OF_ENTITIES,
                       sizeof(entities[0]), *comp_entities);
                  if (res)
                    {
                      *chPtr = (Tcl_UniChar) res->value;
                      return ++i;
                    }
                  break;
               }
              *p++ = byte;
            }
        }
    }

  /*
   * Unroll 1 to 3 byte UTF-8 sequences, use loop to handle longer ones.
   */

  byte = *((unsigned char *) str);
#ifdef JISX0208
  if (0xA1 <= byte && byte <= 0xFE)
    {
      int ku, ten;

      ku = (byte & 0x7F) - 0x20;
      ten = (str[1] & 0x7F) - 0x20;
      if ((ku < 1 || ku > 92) || (ten < 1 || ten > 94))
	{
	  *chPtr = (Tcl_UniChar) byte;
	  return 1;
	}

      *chPtr = (Tcl_UniChar) UnicodeTbl[ku - 1][ten - 1];
      return 2;
    }
  else
#endif /* JISX0208 */
  if (byte < 0xC0)
    {
      /*
       * Handles properly formed UTF-8 characters between
       * 0x01 and 0x7F.  Also treats \0 and naked trail
       * bytes 0x80 to 0xBF as valid characters representing
       * themselves.
       */

      *chPtr = (Tcl_UniChar) byte;
      return 1;
    }
  else if (byte < 0xE0)
    {
      if ((str[1] & 0xC0) == 0x80)
	{
	  /*
	   * Two-byte-character lead-byte followed
	   * by a trail-byte.
	   */

	  *chPtr = (Tcl_UniChar) (((byte & 0x1F) << 6) | (str[1] & 0x3F));
	  return 2;
	}
      /*
       * A two-byte-character lead-byte not followed by trail-byte
       * represents itself.
       */

      *chPtr = (Tcl_UniChar) byte;
      return 1;
    }
  else if (byte < 0xF0)
    {
      if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80))
	{
	  /*
	   * Three-byte-character lead byte followed by
	   * two trail bytes.
	   */

	  *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12)
				  | ((str[1] & 0x3F) << 6) | (str[2] & 0x3F));
	  return 3;
	}
      /*
       * A three-byte-character lead-byte not followed by
       * two trail-bytes represents itself.
       */

      *chPtr = (Tcl_UniChar) byte;
      return 1;
    }
#if TCL_UTF_MAX > 3
  else
    {
      int ch, total, trail;

      total = totalBytes[byte];
      trail = total - 1;
      if (trail > 0)
	{
	  ch = byte & (0x3F >> trail);
	  do
	    {
	      str++;
	      if ((*str & 0xC0) != 0x80)
		{
		  *chPtr = byte;
		  return 1;
		}
	      ch <<= 6;
	      ch |= (*str & 0x3F);
	      trail--;
	    }
	  while (trail > 0);
	  *chPtr = ch;
	  return total;
	}
    }
#endif

  *chPtr = (Tcl_UniChar) byte;
  return 1;
}

/********************************************************************/
/* font cache functions                                             */

static int
fontTest (void *element, void *key)
{
  font_t *a = (font_t *) element;
  fontkey_t *b = (fontkey_t *) key;

  return (strcmp (a->fontlist, b->fontlist) == 0 && a->flags == b->flags);
}

static int useFontConfig(int flag)
{
	if (fontConfigFlag) {
		return (!(flag & gdFTEX_FONTPATHNAME));
	} else {
		return flag & gdFTEX_FONTCONFIG;
	}
}

static void *
fontFetch (char **error, void *key)
{
  font_t *a;
  fontkey_t *b = (fontkey_t *) key;
  char *suffix;
  FT_Error err;

  *error = NULL;

  a = (font_t *) gdMalloc (sizeof (font_t));
	if (!a) {
		return NULL;
	}

  a->fontlist = strdup (b->fontlist);
  a->flags = b->flags;
  a->library = b->library;
  a->fontpath = NULL;

#ifdef HAVE_LIBFONTCONFIG
  if (!useFontConfig(b->flags))
  	*error = font_path(&(a->fontpath), a->fontlist);
              else
  	*error = font_pattern(&(a->fontpath), a->fontlist);
#else
  *error = font_path(&(a->fontpath), a->fontlist);
#endif /* HAVE_LIBFONTCONFIG */
  if (*error || !a->fontpath || !a->fontpath[0])
                {
      /* 2.0.12: TBB: free these. Thanks to Frank Faubert. */
      free (a->fontlist);
      if (a->fontpath)
	free (a->fontpath);
      gdFree (a);

      if (! *error)
	*error = "font_path() returned an empty font pathname";

      return NULL;
    }

#if 0
fprintf(stderr,"fontpathname=%s\n",fullname);
#endif

  err = FT_New_Face(*b->library, a->fontpath, 0, &a->face);

  /* Read kerning metrics for Postscript fonts. */
  if (!err
      && ((suffix = strstr(a->fontpath, ".pfa"))
	  || (suffix = strstr(a->fontpath, ".pfb")))
      && ((strcpy(suffix, ".afm") && (access(a->fontpath, R_OK) == 0))
	  || (strcpy(suffix, ".pfm") && (access(a->fontpath, R_OK) == 0))))
  {
    err = FT_Attach_File(a->face, a->fontpath);
  }

  if (err)
    {
      /* 2.0.12: TBB: free these. Thanks to Frank Faubert. */
      free (a->fontlist);
      free (a->fontpath);
      gdFree (a);
      *error = "Could not read font";
      return NULL;
    }

  return (void *) a;
}

static void
fontRelease (void *element)
{
  font_t *a = (font_t *) element;

  FT_Done_Face (a->face);
  gdFree (a->fontlist);
  gdFree (a->fontpath);
  gdFree ((char *) element);
}

/********************************************************************/
/* tweencolor cache functions                                            */

static int
tweenColorTest (void *element, void *key)
{
  tweencolor_t *a = (tweencolor_t *) element;
  tweencolorkey_t *b = (tweencolorkey_t *) key;

  return (a->pixel == b->pixel
	  && a->bgcolor == b->bgcolor
	  && a->fgcolor == b->fgcolor && a->im == b->im);
}

/*
 * Computes a color in im's color table that is part way between
 * the background and foreground colors proportional to the gray
 * pixel value in the range 0-GD_NUMCOLORS. The fg and bg colors must already
 * be in the color table for palette images. For truecolor images the
 * returned value simply has an alpha component and gdImageAlphaBlend
 * does the work so that text can be alpha blended across a complex
 * background (TBB; and for real in 2.0.2).
 */
static void *
tweenColorFetch (char **error, void *key)
{
  tweencolor_t *a;
  tweencolorkey_t *b = (tweencolorkey_t *) key;
  int pixel, npixel, bg, fg;
  gdImagePtr im;

  a = (tweencolor_t *) gdMalloc (sizeof (tweencolor_t));
	if (!a) {
		return NULL;
	}

  pixel = a->pixel = b->pixel;
  bg = a->bgcolor = b->bgcolor;
  fg = a->fgcolor = b->fgcolor;
  im = a->im = b->im;

  /* if fg is specified by a negative color idx, then don't antialias */
  if (fg < 0)
    {
      if ((pixel + pixel) >= GD_NUMCOLORS)
	a->tweencolor = -fg;
      else
	a->tweencolor = bg;
    }
  else
    {
      npixel = GD_NUMCOLORS - pixel;
      if (im->trueColor)
	{
	  /* 2.0.1: use gdImageSetPixel to do the alpha blending work,
	     or to just store the alpha level. All we have to do here
	     is incorporate our knowledge of the percentage of this
	     pixel that is really "lit" by pushing the alpha value
	     up toward transparency in edge regions. */
	  a->tweencolor = gdTrueColorAlpha (gdTrueColorGetRed (fg),
					    gdTrueColorGetGreen (fg),
					    gdTrueColorGetBlue (fg),
					    gdAlphaMax -
					    (gdTrueColorGetAlpha (fg) *
					     pixel / GD_NUMCOLORS));
	}
      else
	{
	  a->tweencolor = gdImageColorResolve (im,
					       (pixel * im->red[fg] +
						npixel * im->red[bg]) /
					       GD_NUMCOLORS,
					       (pixel * im->green[fg] +
						npixel * im->green[bg]) /
					       GD_NUMCOLORS,
					       (pixel * im->blue[fg] +
						npixel * im->blue[bg]) /
					       GD_NUMCOLORS);
	}
    }
  return (void *) a;
}

static void
tweenColorRelease (void *element)
{
  gdFree ((char *) element);
}

/* draw_bitmap - transfers glyph bitmap to GD image */
static char *
gdft_draw_bitmap (gdCache_head_t * tc_cache, gdImage * im, int fg,
		  FT_Bitmap bitmap, int pen_x, int pen_y)
{
  unsigned char *pixel = NULL;
  int *tpixel = NULL;
  int opixel;
  int x, y, row, col, pc, pcr;

  tweencolor_t *tc_elem;
  tweencolorkey_t tc_key;

  /* copy to image, mapping colors */
  tc_key.fgcolor = fg;
  tc_key.im = im;
  /* Truecolor version; does not require the cache */
  if (im->trueColor)
    {
      for (row = 0; row < bitmap.rows; row++)
	{
	  pc = row * bitmap.pitch;
	  pcr = pc;
	  y = pen_y + row;
	  /* clip if out of bounds */
	  /* 2.0.16: clipping rectangle, not image bounds */
	  if ((y > im->cy2) || (y < im->cy1))
	    continue;
	  for (col = 0; col < bitmap.width; col++, pc++)
	    {
	      int level;
	      if (bitmap.pixel_mode == ft_pixel_mode_grays)
		{
		  /*
		   * Scale to 128 levels of alpha for gd use.
		   * alpha 0 is opacity, so be sure to invert at the end
		   */
		  level = (bitmap.buffer[pc] * gdAlphaMax /
			   (bitmap.num_grays - 1));
		}
	      else if (bitmap.pixel_mode == ft_pixel_mode_mono)
		{
		  /* 2.0.5: mode_mono fix from Giuliano Pochini */
		  level =
		    ((bitmap.
		      buffer[(col >> 3) +
			     pcr]) & (1 << (~col & 0x07))) ?
		    gdAlphaTransparent : gdAlphaOpaque;
		}
	      else
		{
		  return "Unsupported ft_pixel_mode";
		}
              if (level == 0)  /* if background */
		continue;

	      if ((fg >= 0) && (im->trueColor))
		{
		  /* Consider alpha in the foreground color itself to be an
		     upper bound on how opaque things get, when truecolor is
		     available. Without truecolor this results in far too many
		     color indexes. */
		  level =
		    level * (gdAlphaMax -
			     gdTrueColorGetAlpha (fg)) / gdAlphaMax;
		}
	      level = gdAlphaMax - level;   /* inverting to get alpha */
	      x = pen_x + col;
	      /* clip if out of bounds */
	      /* 2.0.16: clip to clipping rectangle, Matt McNabb */
	      if ((x > im->cx2) || (x < im->cx1))
		continue;
	      /* get pixel location in gd buffer */
	      tpixel = &im->tpixels[y][x];
	      if (fg < 0)
		{
		  if (level < (gdAlphaMax / 2))
		    {
		      *tpixel = -fg;
		    }
		}
	      else
		{
		  if (im->alphaBlendingFlag)
		    {
		      opixel = *tpixel;
		      if (gdTrueColorGetAlpha(opixel) != gdAlphaTransparent)
			{
			  *tpixel = gdAlphaBlend (opixel,
				      (level << 24) + (fg & 0xFFFFFF));
			}
		      else
			{
			  *tpixel = (level << 24) + (fg & 0xFFFFFF);
			}
		    }
		  else
		    {
		      *tpixel = (level << 24) + (fg & 0xFFFFFF);
		    }
		}
	    }
	}
      return (char *) NULL;
    }
  /* Non-truecolor case, restored to its more or less original form */
  for (row = 0; row < bitmap.rows; row++)
    {
      int pcr;
      pc = row * bitmap.pitch;
      pcr = pc;
      if (bitmap.pixel_mode == ft_pixel_mode_mono)
	pc *= 8;		/* pc is measured in bits for monochrome images */

      y = pen_y + row;

      /* clip if out of bounds */
      if (y > im->cy2 || y < im->cy1)
	continue;

      for (col = 0; col < bitmap.width; col++, pc++)
	{
	  if (bitmap.pixel_mode == ft_pixel_mode_grays)
	    {
	      /*
	       * Round to GD_NUMCOLORS levels of antialiasing for
	       * index color images since only 256 colors are
	       * available.
	       */
	      tc_key.pixel = ((bitmap.buffer[pc] * GD_NUMCOLORS)
			      + bitmap.num_grays / 2)
		/ (bitmap.num_grays - 1);
	    }
	  else if (bitmap.pixel_mode == ft_pixel_mode_mono)
	    {
	      tc_key.pixel = ((bitmap.buffer[pc / 8]
			       << (pc % 8)) & 128) ? GD_NUMCOLORS : 0;
	      /* 2.0.5: mode_mono fix from Giuliano Pochini */
	      tc_key.pixel =
		((bitmap.
		  buffer[(col >> 3) +
			 pcr]) & (1 << (~col & 0x07))) ? GD_NUMCOLORS : 0;
	    }
	  else
	    {
	      return "Unsupported ft_pixel_mode";
	    }
	  if (tc_key.pixel == 0)	/* if background */
	    continue;

	  x = pen_x + col;

	  /* clip if out of bounds */
	  if (x > im->cx2 || x < im->cx1)
	    continue;
	  /* get pixel location in gd buffer */
	  pixel = &im->pixels[y][x];
	  if (tc_key.pixel == GD_NUMCOLORS)
	    {
	      /* use fg color directly. gd 2.0.2: watch out for
	         negative indexes (thanks to David Marwood). */
	      *pixel = (fg < 0) ? -fg : fg;
	    }
	  else
	    {
	      /* find antialised color */

	      tc_key.bgcolor = *pixel;
	      tc_elem = (tweencolor_t *) gdCacheGet (tc_cache, &tc_key);
	      if (!tc_elem) return tc_cache->error;
	      *pixel = tc_elem->tweencolor;
	    }
	}
    }
  return (char *) NULL;
}

BGD_DECLARE(void) gdFreeFontCache ()
{
  gdFontCacheShutdown ();
}

BGD_DECLARE(void) gdFontCacheShutdown ()
{
  if (fontCache)
    {
			gdMutexLock(gdFontCacheMutex);
      gdCacheDelete (fontCache);
      /* 2.0.16: Gustavo Scotti: make sure we don't free this twice */
      fontCache = 0;
			gdMutexUnlock(gdFontCacheMutex);
      gdMutexShutdown (gdFontCacheMutex);
      FT_Done_FreeType (library);
    }
}

/********************************************************************/
/* gdImageStringFT -  render a utf8 string onto a gd image          */

BGD_DECLARE(char *) gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
		 double ptsize, double angle, int x, int y, char *string)
{
  return gdImageStringFTEx (im, brect, fg, fontlist,
			    ptsize, angle, x, y, string, 0);
}

BGD_DECLARE(int) gdFontCacheSetup (void)
{
  if (fontCache)
    {
      /* Already set up */
      return 0;
    }
  gdMutexSetup (gdFontCacheMutex);
  if (FT_Init_FreeType (&library))
    {
      gdMutexShutdown (gdFontCacheMutex);
      return -1;
    }
  fontCache = gdCacheCreate (FONTCACHESIZE, fontTest, fontFetch, fontRelease);
	if (!fontCache) {
		return -2;
	}
  return 0;
}

/* the platform-independent resolution used for size and position calculations */
/*    the size of the error introduced by rounding is affected by this number */
#define METRIC_RES 300

BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
		   double ptsize, double angle, int x, int y, char *string,
		   gdFTStringExtraPtr strex)
{
  FT_Matrix matrix;
  FT_Vector penf, oldpenf, delta, total_min = {0,0}, total_max = {0,0}, glyph_min, glyph_max;
  FT_Face face;
  FT_CharMap charmap = NULL;
  FT_Glyph image;
  FT_GlyphSlot slot;
  FT_Error err;
  FT_UInt glyph_index, previous;
  double sin_a = sin (angle);
  double cos_a = cos (angle);
  int len, i, ch;
  font_t *font;
  fontkey_t fontkey;
  char *next;
  char *tmpstr = 0;
  int render = (im && (im->trueColor || (fg <= 255 && fg >= -255)));
  FT_BitmapGlyph bm;
  /* 2.0.13: Bob Ostermann: don't force autohint, that's just for testing
     freetype and doesn't look as good */
  int render_mode = FT_LOAD_DEFAULT;
  int encoding, encodingfound;
  /* Now tuneable thanks to Wez Furlong */
  double linespace = LINESPACE;
  /* 2.0.6: put this declaration with the other declarations! */
  /*
   *   make a new tweenColorCache on every call
   *   because caching colormappings between calls
   *   is not safe. If the im-pointer points to a
   *   brand new image, the cache gives out bogus
   *   colorindexes.          -- 27.06.2001 <krisku@arrak.fi>
   */
  gdCache_head_t *tc_cache;
  /* Tuneable horizontal and vertical resolution in dots per inch */
  int hdpi, vdpi, horiAdvance, xshow_alloc = 0, xshow_pos = 0;
  FT_Size platform_specific, platform_independent;

  if (strex)
    {
      if ((strex->flags & gdFTEX_LINESPACE) == gdFTEX_LINESPACE)
	{
	  linespace = strex->linespacing;
	}
    }
  tc_cache = gdCacheCreate (TWEENCOLORCACHESIZE,
			    tweenColorTest, tweenColorFetch,
			    tweenColorRelease);

/***** initialize font library and font cache on first call ******/
  if (!fontCache)
    {
      if (gdFontCacheSetup () != 0)
	{
	  gdCacheDelete (tc_cache);
	  return "Failure to initialize font library";
	}
    }
/*****/
  gdMutexLock (gdFontCacheMutex);
  /* get the font (via font cache) */
  fontkey.fontlist = fontlist;
  if (strex)
  	fontkey.flags = strex->flags & (gdFTEX_FONTPATHNAME |
		gdFTEX_FONTCONFIG);
  else
	fontkey.flags = 0;
  fontkey.library = &library;
  font = (font_t *) gdCacheGet (fontCache, &fontkey);
  if (!font)
    {
      gdCacheDelete (tc_cache);
      gdMutexUnlock (gdFontCacheMutex);
      return fontCache->error;
    }
  face = font->face;		/* shortcut */
  slot = face->glyph;		/* shortcut */

   if (brect)
     {
       total_min.x = total_min.y = 0;
       total_max.x = total_max.y = 0;
     }

  /*
   * Added hdpi and vdpi to support images at non-screen resolutions, i.e. 300 dpi TIFF,
   *    or 100h x 50v dpi FAX format. 2.0.23.
   * 2004/02/27 Mark Shackelford, mark.shackelford@acs-inc.com
   */
  hdpi = GD_RESOLUTION;
  vdpi = GD_RESOLUTION;
  encoding = gdFTEX_Unicode;
  if (strex)
    {
      if (strex->flags & gdFTEX_RESOLUTION)
    {
      hdpi = strex->hdpi;
      vdpi = strex->vdpi;
    }
      if (strex->flags & gdFTEX_XSHOW)
        {
          strex->xshow = NULL;
        }
      /* 2.0.12: allow explicit specification of the preferred map;
         but we still fall back if it is not available. */
      if (strex->flags & gdFTEX_CHARMAP)
        {
          encoding = strex->charmap;
        }
      /* 2.0.29: we can return the font path if desired */
      if (strex->flags & gdFTEX_RETURNFONTPATHNAME)
        strex->fontpath = strdup(font->fontpath);
    }

  matrix.xx = (FT_Fixed) (cos_a * (1 << 16));
  matrix.yx = (FT_Fixed) (sin_a * (1 << 16));
  matrix.xy = -matrix.yx;
  matrix.yy = matrix.xx;

  /* set rotation transform */
  FT_Set_Transform (face, &matrix, NULL);

  FT_New_Size (face, &platform_independent);
  FT_Activate_Size (platform_independent);
  if (FT_Set_Char_Size (face, 0, (FT_F26Dot6)(ptsize*64), METRIC_RES, METRIC_RES))
    {
      gdCacheDelete (tc_cache);
      gdMutexUnlock (gdFontCacheMutex);
      return "Could not set character size";
    }

  if (render)
    {
      FT_New_Size (face, &platform_specific);
      FT_Activate_Size (platform_specific);
      if (FT_Set_Char_Size (face, 0, (FT_F26Dot6)(ptsize*64), hdpi, vdpi))
        {
          gdCacheDelete (tc_cache);
          gdMutexUnlock (gdFontCacheMutex);
          return "Could not set character size";
        }
    }

  if (fg < 0)
      render_mode |= FT_LOAD_MONOCHROME;

  /* find requested charmap */
  encodingfound = 0;
  for (i = 0; i < face->num_charmaps; i++)
    {
      charmap = face->charmaps[i];

#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 3)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
      if (encoding == gdFTEX_Unicode)
	{
	  if (charmap->encoding == FT_ENCODING_MS_SYMBOL
	      || charmap->encoding == FT_ENCODING_UNICODE
	      || charmap->encoding == FT_ENCODING_ADOBE_CUSTOM
	      || charmap->encoding == FT_ENCODING_ADOBE_STANDARD)
	    {
	      encodingfound++;
	      break;
	    }
	}
      else if (encoding == gdFTEX_Adobe_Custom)
	{
	  if (charmap->encoding == FT_ENCODING_ADOBE_CUSTOM)
	    {
	      encodingfound++;
	      break;
	    }
	}
      else if (encoding == gdFTEX_Big5)
	{
/* renamed sometime after freetype-2.1.4 */
#ifndef FT_ENCODING_BIG5
#define FT_ENCODING_BIG5 FT_ENCODING_MS_BIG5
#endif
	  if (charmap->encoding == FT_ENCODING_BIG5)
	    {
	      encodingfound++;
	      break;
	    }
	}
      else if (encoding == gdFTEX_Shift_JIS)
	{
/* renamed sometime after freetype-2.1.4 */
#ifndef FT_ENCODING_SJIS
#define FT_ENCODING_SJIS FT_ENCODING_MS_SJIS
#endif
	  if (charmap->encoding == FT_ENCODING_SJIS)
	    {
	      encodingfound++;
	      break;
	    }
	}
#else
      if (encoding == gdFTEX_Unicode)
	{
	  if ((charmap->platform_id = 3 && charmap->encoding_id == 1)     /* Windows Unicode */
	      || (charmap->platform_id == 3 && charmap->encoding_id == 0) /* Windows Symbol */
	      || (charmap->platform_id == 2 && charmap->encoding_id == 1) /* ISO Unicode */
	      || (charmap->platform_id == 0))                          /* Apple Unicode */
	    {
	      encodingfound++;
	      break;
	    }
	}
      else if (encoding == gdFTEX_Big5)
	{
          if (charmap->platform_id == 3 && charmap->encoding_id == 4)     /* Windows Big5 */
	    {
	      encodingfound++;
	      break;
	    }
	}
      else if (encoding == gdFTEX_Shift_JIS)
	{
          if (charmap->platform_id == 3 && charmap->encoding_id == 2)     /* Windows Sjis */
	    {
	      encodingfound++;
	      break;
	    }
	}
#endif
    }
  if (encodingfound)
    {
      FT_Set_Charmap(face, charmap);
    }
  else
    {
      /* No character set found! */
      gdCacheDelete (tc_cache);
      gdMutexUnlock (gdFontCacheMutex);
      return "No character set found";
    }

#ifndef JISX0208
  if (encoding == gdFTEX_Shift_JIS)
    {
#endif
      if ((tmpstr = (char *) gdMalloc (BUFSIZ)))
	{
	  any2eucjp (tmpstr, string, BUFSIZ);
	  next = tmpstr;
	}
      else
	{
	  next = string;
	}
#ifndef JISX0208
    }
  else
    {
      next = string;
    }
#endif

#if 0
fprintf(stderr,"dpi=%d,%d metric_res=%d ptsize=%g\n",hdpi,vdpi,METRIC_RES,ptsize);
#endif

  oldpenf.x = oldpenf.y = 0; /* for postscript xshow operator */
  penf.x = penf.y = 0;	/* running position of non-rotated glyphs */
  previous = 0;		/* index of previous glyph for kerning calculations */
  for (i=0; *next; i++)
    {
      FT_Activate_Size (platform_independent);

      ch = *next;

      /* carriage returns */
      if (ch == '\r')
	{
	  penf.x = 0;
	  previous = 0;		/* clear kerning flag */
	  next++;
	  continue;
	}
      /* newlines */
      if (ch == '\n')
	{
	  /* 2.0.13: reset penf.x. Christopher J. Grayce */
	  penf.x = 0;
	  penf.y += linespace * ptsize * 64 * METRIC_RES / 72;
	  penf.y &= ~63;	/* round down to 1/METRIC_RES */
	  previous = 0;		/* clear kerning flag */
	  next++;
	  continue;
	}

        switch (encoding)
	  {
	  case gdFTEX_Unicode:
	    {
	      /* use UTF-8 mapping from ASCII */
	      len = gdTcl_UtfToUniChar (next, &ch);
/* EAM DEBUG */
/* TBB: get this exactly right: 2.1.3 *or better*, all possible cases. */
/* 2.0.24: David R. Morrison: use the more complete ifdef here. */
#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 3)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
      	      if (charmap->encoding == FT_ENCODING_MS_SYMBOL)
#else
	      if (charmap->platform_id == 3 && charmap->encoding_id == 0)
#endif /* Freetype 2.1 or better */
		{
		  /* I do not know the significance of the constant 0xf000. */
		  /* It was determined by inspection of the character codes */
		  /* stored in Microsoft font symbol.ttf                    */
		  ch |= 0xf000;
		}
/* EAM DEBUG */
	      next += len;
	    }
	    break;
	  case gdFTEX_Shift_JIS:
	    {
	      unsigned char c;
	      int jiscode;
	      c = *next;
	      if (0xA1 <= c && c <= 0xFE)
	        {
	          next++;
	          jiscode = 0x100 * (c & 0x7F) + ((*next) & 0x7F);

		  ch = (jiscode >> 8) & 0xFF;
		  jiscode &= 0xFF;

		  if (ch & 1)
		    jiscode += 0x40 - 0x21;
		  else
		    jiscode += 0x9E - 0x21;

		  if (jiscode >= 0x7F)
		    jiscode++;
		  ch = (ch - 0x21) / 2 + 0x81;
		  if (ch >= 0xA0)
		    ch += 0x40;

		  ch = (ch << 8) + jiscode;
		}
	      else
		{
		  ch = c & 0xFF;	/* don't extend sign */
		}
	      if (*next) next++;
	    }
	    break;
	  case gdFTEX_Big5:
	    {
	      /*
	       * Big 5 mapping:
	       * use "JIS-8 half-width katakana" coding from 8-bit characters. Ref:
	       * ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/japan.inf-032092.sjs
	       */
	      ch = (*next) & 0xFF;	/* don't extend sign */
	      next++;
	      if (ch >= 161	/* first code of JIS-8 pair */
		  && *next)
		{		/* don't advance past '\0' */
		  /* TBB: Fix from Kwok Wah On: & 255 needed */
		  ch = (ch * 256) + ((*next) & 255);
		  next++;
		}
	    }
	    break;

	  case gdFTEX_Adobe_Custom:
	  default:
			ch &= 0xFF;
	    next++;
	    break;
	  }

      /* Convert character code to glyph index */
      glyph_index = FT_Get_Char_Index (face, ch);

      /* retrieve kerning distance */
      if ( ! (strex && (strex->flags & gdFTEX_DISABLE_KERNING))
		&& ! FT_IS_FIXED_WIDTH(face)
		&& FT_HAS_KERNING(face)
		&& previous
		&& glyph_index)
        FT_Get_Kerning (face, previous, glyph_index, ft_kerning_default, &delta);
      else
	delta.x = delta.y = 0;

	  penf.x += delta.x;

      /* When we know the position of the second or subsequent character,
	save the (kerned) advance from the preceeding character in the
	xshow vector */
      if (i && strex && (strex->flags & gdFTEX_XSHOW))
        {
	  /* make sure we have enough allocation for two numbers
		so we don't have to recheck for the terminating number */
	  if (! xshow_alloc) {
			xshow_alloc = 100;
			strex->xshow = gdMalloc(xshow_alloc);
			if (!strex->xshow) {
				if (tmpstr)
				  gdFree (tmpstr);
				gdCacheDelete (tc_cache);
				gdMutexUnlock (gdFontCacheMutex);
				return "Problem allocating memory";
			}
			xshow_pos = 0;
	  }
	  else if (xshow_pos + 20 > xshow_alloc) {
		xshow_alloc += 100;
		strex->xshow = gdRealloc(strex->xshow, xshow_alloc);
		if (!strex->xshow) {
			if (tmpstr)
			  gdFree (tmpstr);
			gdCacheDelete (tc_cache);
			gdMutexUnlock (gdFontCacheMutex);
			return "Problem allocating memory";
		}
	}
	  xshow_pos += sprintf(strex->xshow + xshow_pos, "%g ",
		(double)(penf.x - oldpenf.x) * hdpi / (64 * METRIC_RES));
        }
      oldpenf.x = penf.x;

      /* load glyph image into the slot (erase previous one) */
      err = FT_Load_Glyph (face, glyph_index, render_mode);
      if (err)
	{
	  if (tmpstr)
	    gdFree (tmpstr);
	  gdCacheDelete (tc_cache);
	  gdMutexUnlock (gdFontCacheMutex);
	  return "Problem loading glyph";
	}

      horiAdvance = slot->metrics.horiAdvance;

      if (brect)
	{			/* only if need brect */

	  glyph_min.x = penf.x + slot->metrics.horiBearingX;
	  glyph_min.y = penf.y - slot->metrics.horiBearingY;

#if 0
	  if (ch == ' ')        /* special case for trailing space */
            {
              glyph_max.x = penf.x + horiAdvance;
            }
          else
            {
	      glyph_max.x = glyph_min.x + slot->metrics.width;
            }
#else
          glyph_max.x = penf.x + horiAdvance;
#endif
	  glyph_max.y = glyph_min.y + slot->metrics.height;

	  if (i==0)
	    {
	      total_min = glyph_min;
	      total_max = glyph_max;
	    }
	  else
	    {
              if (glyph_min.x < total_min.x)
                  total_min.x = glyph_min.x;
              if (glyph_min.y < total_min.y)
                  total_min.y = glyph_min.y;
              if (glyph_max.x > total_max.x)
                  total_max.x = glyph_max.x;
              if (glyph_max.y > total_max.y)
                  total_max.y = glyph_max.y;
	    }
	}

      if (render)
	{
          FT_Activate_Size (platform_specific);

          /* load glyph again into the slot (erase previous one)  - this time with scaling */
          err = FT_Load_Glyph (face, glyph_index, render_mode);
          if (err)
	    {
	      if (tmpstr)
	        gdFree (tmpstr);
	      gdCacheDelete (tc_cache);
	      gdMutexUnlock (gdFontCacheMutex);
	      return "Problem loading glyph";
	    }

          /* load and transform glyph image */
          FT_Get_Glyph (slot, &image);

	  if (image->format != ft_glyph_format_bitmap)
	    {
	      err = FT_Glyph_To_Bitmap (&image, ft_render_mode_normal, 0, 1);
	      if (err)
		{
		  FT_Done_Glyph(image);
		  if (tmpstr)
		    gdFree (tmpstr);
		  gdCacheDelete (tc_cache);
		  gdMutexUnlock (gdFontCacheMutex);
		  return "Problem rendering glyph";
		}
	    }

	  /* now, draw to our target surface */
	  bm = (FT_BitmapGlyph) image;
          /* position rounded down to nearest pixel at current dpi
		 (the estimate was rounded up to next 1/METRIC_RES, so this should fit) */
	  gdft_draw_bitmap (tc_cache, im, fg, bm->bitmap,
                    (int)(x + (penf.x * cos_a + penf.y * sin_a)*hdpi/(METRIC_RES*64) + bm->left),
                    (int)(y - (penf.x * sin_a - penf.y * cos_a)*vdpi/(METRIC_RES*64) - bm->top));

          FT_Done_Glyph (image);
	}

      /* record current glyph index for kerning */
      previous = glyph_index;

      penf.x += horiAdvance;
    }

  /* Save the (unkerned) advance from the last character in the xshow vector */
  if (strex && (strex->flags & gdFTEX_XSHOW) && strex->xshow)
    {
	sprintf(strex->xshow + xshow_pos, "%g",
                (double)(penf.x - oldpenf.x) * hdpi / (64 * METRIC_RES) );
    }

  if (brect)
    {				/* only if need brect */
			double scalex = (double)hdpi / (64 * METRIC_RES);
			double scaley = (double)vdpi / (64 * METRIC_RES);

      /* increase by 1 pixel to allow for rounding */
      total_min.x -= METRIC_RES;
      total_min.y -= METRIC_RES;
      total_max.x += METRIC_RES;
      total_max.y += METRIC_RES;

      /* rotate bounding rectangle, scale and round to int pixels, and translate */
			brect[0] = x + (total_min.x * cos_a + total_max.y * sin_a)*scalex;
			brect[1] = y - (total_min.x * sin_a - total_max.y * cos_a)*scaley;
			brect[2] = x + (total_max.x * cos_a + total_max.y * sin_a)*scalex;
      brect[3] = y - (total_max.x * sin_a - total_max.y * cos_a)*scaley;
      brect[4] = x + (total_max.x * cos_a + total_min.y * sin_a)*scalex;
      brect[5] = y - (total_max.x * sin_a - total_min.y * cos_a)*scaley;
      brect[6] = x + (total_min.x * cos_a + total_min.y * sin_a)*scalex;
      brect[7] = y - (total_min.x * sin_a - total_min.y * cos_a)*scaley;
    }

  FT_Done_Size (platform_independent);
  if (render)
    FT_Done_Size (platform_specific);

  if (tmpstr)
    gdFree (tmpstr);
  gdCacheDelete (tc_cache);
  gdMutexUnlock (gdFontCacheMutex);
  return (char *) NULL;
}

#endif /* HAVE_LIBFREETYPE */

#ifdef HAVE_LIBFONTCONFIG
/* Code to find font path, with special mapping for Postscript font names.
 *
 * Dag Lem <dag@nimrod.no>
 */

#include <fontconfig/fontconfig.h>

/* #define NO_POSTSCRIPT_ALIAS 1 */
#ifndef NO_POSTSCRIPT_ALIAS
typedef struct _PostscriptAlias {
  char* name;
  char* family;
  char* style;
} PostscriptAlias;

/* This table maps standard Postscript font names to URW Type 1 fonts.
   The mapping is converted from Ghostscript (Fontmap.GS)
   for use with fontconfig. */
static PostscriptAlias postscript_alias[] = {
  { "AvantGarde-Book", "URW Gothic L", "Book" },
  { "AvantGarde-BookOblique", "URW Gothic L", "Book Oblique" },
  { "AvantGarde-Demi", "URW Gothic L", "Demi" },
  { "AvantGarde-DemiOblique", "URW Gothic L", "Demi Oblique" },

  { "Bookman-Demi", "URW Bookman L", "Demi Bold" },
  { "Bookman-DemiItalic", "URW Bookman L", "Demi Bold Italic" },
  { "Bookman-Light", "URW Bookman L", "Light" },
  { "Bookman-LightItalic", "URW Bookman L", "Light Italic" },

  { "Courier", "Nimbus Mono L", "Regular" },
  { "Courier-Oblique", "Nimbus Mono L", "Regular Oblique" },
  { "Courier-Bold", "Nimbus Mono L", "Bold" },
  { "Courier-BoldOblique", "Nimbus Mono L", "Bold Oblique" },

  { "Helvetica", "Nimbus Sans L", "Regular" },
  { "Helvetica-Oblique", "Nimbus Sans L", "Regular Italic" },
  { "Helvetica-Bold", "Nimbus Sans L", "Bold" },
  { "Helvetica-BoldOblique", "Nimbus Sans L", "Bold Italic" },

  { "Helvetica-Narrow", "Nimbus Sans L", "Regular Condensed" },
  { "Helvetica-Narrow-Oblique", "Nimbus Sans L", "Regular Condensed Italic" },
  { "Helvetica-Narrow-Bold", "Nimbus Sans L", "Bold Condensed" },
  { "Helvetica-Narrow-BoldOblique", "Nimbus Sans L", "Bold Condensed Italic" },

  { "NewCenturySchlbk-Roman", "Century Schoolbook L", "Roman" },
  { "NewCenturySchlbk-Italic", "Century Schoolbook L", "Italic" },
  { "NewCenturySchlbk-Bold", "Century Schoolbook L", "Bold" },
  { "NewCenturySchlbk-BoldItalic", "Century Schoolbook L", "Bold Italic" },

  { "Palatino-Roman", "URW Palladio L", "Roman" },
  { "Palatino-Italic", "URW Palladio L", "Italic" },
  { "Palatino-Bold", "URW Palladio L", "Bold" },
  { "Palatino-BoldItalic", "URW Palladio L", "Bold Italic" },

  { "Symbol", "Standard Symbols L", "Regular" },

  { "Times-Roman", "Nimbus Roman No9 L", "Regular" },
  { "Times-Italic", "Nimbus Roman No9 L", "Regular Italic" },
  { "Times-Bold", "Nimbus Roman No9 L", "Medium" },
  { "Times-BoldItalic", "Nimbus Roman No9 L", "Medium Italic" },

  { "ZapfChancery-MediumItalic", "URW Chancery L", "Medium Italic" },

  { "ZapfDingbats", "Dingbats", "" },
};
#endif

static FcPattern* find_font(FcPattern* pattern)
{
  FcResult result;

  FcConfigSubstitute(0, pattern, FcMatchPattern);
  FcConfigSubstitute(0, pattern, FcMatchFont);
  FcDefaultSubstitute(pattern);

  return FcFontMatch(0, pattern, &result);
}

#ifndef NO_POSTSCRIPT_ALIAS
static char* find_postscript_font(FcPattern **fontpattern, char* fontname)
{
  FcPattern* font = NULL;
  int i;

  *fontpattern = NULL;
  for (i = 0; i < sizeof(postscript_alias)/sizeof(*postscript_alias); i++) {
    if (strcmp(fontname, postscript_alias[i].name) == 0) {
      FcChar8* family;

      FcPattern* pattern =
	FcPatternBuild(0,
		       FC_FAMILY, FcTypeString, postscript_alias[i].family,
		       FC_STYLE, FcTypeString, postscript_alias[i].style,
		       (char*)0);
      font = find_font(pattern);
      FcPatternDestroy(pattern);

      if (!font)
        return "fontconfig: Couldn't find font.";
      if (FcPatternGetString(font, FC_FAMILY, 0, &family) != FcResultMatch) {
        FcPatternDestroy(font);
        return "fontconfig: Couldn't retrieve font family name.";
      }

      /* Check whether we got the font family we wanted. */
      if (strcmp((const char *)family, postscript_alias[i].family) != 0) {
	FcPatternDestroy(font);
	return "fontconfig: Didn't find expected font family. Perhaps URW Type 1 fonts need installing?";
      }
      break;
    }
  }

  *fontpattern = font;
  return NULL;
}
#endif

static char * font_pattern(char **fontpath, char *fontpattern)
{
  FcPattern* font = NULL;
  FcChar8* file;
  FcPattern* pattern;
#ifndef NO_POSTSCRIPT_ALIAS
  char *error;
#endif

  *fontpath = NULL;
#ifndef NO_POSTSCRIPT_ALIAS
  error = find_postscript_font(&font, fontpattern);

  if (!font) {
    if (error)
      return error;
#endif
    pattern = FcNameParse((const FcChar8 *)fontpattern);
    font = find_font(pattern);
    FcPatternDestroy(pattern);
#ifndef NO_POSTSCRIPT_ALIAS
  }
#endif

  if (!font)
    return "fontconfig: Couldn't find font.";
  if (FcPatternGetString(font, FC_FILE, 0, &file) != FcResultMatch) {
    FcPatternDestroy(font);
    return "fontconfig: Couldn't retrieve font file name.";
  }

  *fontpath = strdup((const char *)file);

  FcPatternDestroy(font);

  return NULL;
}

#endif /* HAVE_LIBFONTCONFIG */

/* Look up font using font names as file names. */
static char * font_path(char **fontpath, char *name_list)
{
  int font_found = 0;
  char *fontsearchpath, *fontlist;
  char *fullname = NULL;
  char *name, *path, *dir;
  char *strtok_ptr;

  /*
   * Search the pathlist for any of a list of font names.
   */
  *fontpath = NULL;
  fontsearchpath = getenv ("GDFONTPATH");
  if (!fontsearchpath)
    fontsearchpath = DEFAULT_FONTPATH;
  fontlist = strdup (name_list);

  /*
   * Must use gd_strtok_r else pointer corrupted by strtok in nested loop.
   */
  for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name;
       name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr))
    {
      char *path_ptr;

      /* make a fresh copy each time - strtok corrupts it. */
      path = strdup (fontsearchpath);
      /*
       * Allocate an oversized buffer that is guaranteed to be
       * big enough for all paths to be tested.
       */
      /* 2.0.22: Thorben Kundinger: +8 is needed, not +6. */
      fullname = gdRealloc (fullname,
                          strlen (fontsearchpath) + strlen (name) + 8);
      if (!fullname) {
          free (path);
          free (fontlist);
          return "could not alloc full path of font";
      }
      /* if name is an absolute or relative pathname then test directly */
#ifdef NETWARE
      /* netware uses the format "volume:/path" or the standard "/path" */
      if (name[0] != 0 && (strstr(name, ":/") || name[0] == '/'))
#else
      if (strchr (name, '/')
	  || (name[0] != 0 && name[1] == ':'
	      && (name[2] == '/' || name[2] == '\\')))
#endif
	{
	  sprintf (fullname, "%s", name);
	  if (access (fullname, R_OK) == 0)
	    {
	      font_found++;
              /* 2.0.16: memory leak fixed, Gustavo Scotti */
              free (path);
	      break;
	    }
	}
      for (dir = gd_strtok_r (path, PATHSEPARATOR, &path_ptr); dir;
           dir = gd_strtok_r (0, PATHSEPARATOR, &path_ptr))
	{
          if (strchr (name, '.'))
	    {
	      sprintf (fullname, "%s/%s", dir, name);
	      if (access (fullname, R_OK) == 0)
	        {
	          font_found++;
	          break;
	        }
	      else
		{
		  continue;
		}
            }
	  sprintf (fullname, "%s/%s.ttf", dir, name);
	  if (access (fullname, R_OK) == 0)
	    {
	      font_found++;
	      break;
	    }
	  sprintf (fullname, "%s/%s.pfa", dir, name);
	  if (access (fullname, R_OK) == 0)
	    {
	      font_found++;
	      break;
	    }
	  sprintf (fullname, "%s/%s.pfb", dir, name);
	  if (access (fullname, R_OK) == 0)
	    {
	      font_found++;
	      break;
	    }
	  sprintf (fullname, "%s/%s.dfont", dir, name);
	  if (access (fullname, R_OK) == 0)
	    {
	      font_found++;
	      break;
	    }
	}
      free (path);
      if (font_found)
	break;
    }
  free (fontlist);
  if (!font_found)
    {
      gdFree (fullname);
      return "Could not find/open font";
    }

  *fontpath = fullname;
  return NULL;
}

BGD_DECLARE(int) gdFTUseFontConfig(int flag)
{
#ifdef HAVE_LIBFONTCONFIG
	fontConfigFlag = flag;
	return 1;
#else
	return 0;
#endif /* HAVE_LIBFONTCONFIG */
}

redpajama_set_name: RedPajamaGithub


text:
Readers answer the call in support of hometown newspapers
Published 8:14 pm Wednesday, August 18, 2021
By The Jessamine Journal
Back in March when COVID-19 began battering the economy, including small businesses like this newspaper, many of you asked how you could help your hometown newspaper weather the crisis.
Atop our list was a simple request: Subscribe, especially online, where readership had been increasing but subscriptions had not. Giving away our content online, with no subscription revenue to help compensate our journalists who keep the community informed, was simply unsustainable as we headed into a period of unprecedented disruption in advertising revenue, historically our lifeblood.
Nearly six months later, many of you have responded. We have seen more new digital subscribers each month, and that bodes well for community journalism during a time when many newspapers across the country are throwing in the towel, unable to find a way forward.
The combination of digital subscription growth; strategic expense reduction, especially reduced frequency of print publication; funding from a Paycheck Protection Program loan; and loyal employees who work tirelessly on behalf of the newspaper and a community they love has helped us navigate the crisis to date.
We ask that you keep subscribing, and encourage your friends and family to do the same. There's a new way to help that will both lighten your taxload and support community newspapers. Call your U.S. representative and senators and ask them to support bipartisan legislation called the Local Journalism Sustainability Act, which, at this writing, had 29 cosponsors on both sides of the aisle during an era when Republicans and Democrats can't agree on much of anything.
HR 7640 is a series of three tax credits aimed at sustaining the local news business in the years to come. The credits are as follows:
• A five-year non-refundable credit of up to $250 annually to incentivize individual subscriptions to local newspapers. The credit would cover 80% of subscription costs in the first year and 50% of subscription costs in the subsequent four years.
• A five-year refundable credit for local newspapers like ours to employ and adequately compensate journalists.
• A five-year non-refundable tax credit that would incentivize small- to medium-sized businesses to advertise with local newspapers, as well as local radio and television stations. The credit would cover up to $5,000 of advertising costs in the first year and $2,500 in the subsequent four years.
Taken together, these credits would help sustain our newspaper and thousands of others through the COVID-19 crisis and beyond.

redpajama_set_name: RedPajamaCommonCrawl


text:
← Lockdown Week 5
Climbing the Lockdown Mountain(s) →
Another Week in Lockdown
Posted on April 27, 2020 by Fearnan Village Association
Deliveries News
On Friday morning Fearnan Hall car park was really busy with folk queuing for supplies from the Kenmore Bakery van.
As well as getting supplies, it's a chance to catch up with all the local chat and gossip.
The turnout demonstrated how much this service is used and appreciated.
The team in the Courtyard also continues to keep local residents supplied and Friday afternoons are busy with folk coming to collect their orders. Here's Mike loading goodies into the back of Elaine's car.
These guys are providing a brilliant service to our small community and beyond.
The 'Boomers' among us will remember our mothers using a system like this – phoning the local greengrocer every week with an order that was then delivered. Could this become a habit that lasts beyond Covid-19? We hope so!
Dee and Paul at the Ben Lawers Hotel are increasing their delivery nights and their menu.
They will be at Fearnan Village Hall at 5pm on Wednesday with pre-ordered meals.
The poster says it all.
Clapping for Carers
A few more pics of residents making as much noise as they can for Carers – pots and pans, saucepan lids and even a pair of castanets in use.
Some more Lockdown Moments from around and about:
Lesley reports that life goes on as near normal as possible. We are so lucky to live here, dog walks on our doorstep and a garden needing constant attention! Potatoes, onions and shallots are all in and John has it all under control.
Amusements include online scrabble with our son in London (not good for my ego). We cut each other's hair last week – it was great fun, but I came out of it much better than John. I got a bit carried away with the clippers – but at least he doesn't need to think about haircuts for a long, long time!
I've got a couple of books on the go – Becoming by Michelle Obama and Hilary Mantel's last book in the Wolf Hall trilogy: The Mirror and The Light. Happy to lend either, although you might have to wait a while for the Hilary Mantel one as it's nearly 900 pages!
A big thank you to the local shops and businesses who have ensured we can stay at home and eat very well!
Good to see Molly getting in on the act!
Sheila and Peter wish to say 'Howdie to our Lockdown amigos in Fearnan!
I joined Sheila in Edinburgh to 'tough out' the lockdown. Aside from our daily tootles (we have 5 different routes which we also vary by doing them clockwise/anti-clockwise in turn) there is really nothing especially remarkable about our daily routine. We didn't start out with any lofty "mission statement". A 1000-piece jigsaw that we still have aspirations to do lies in wait for when the weather indicates this would be the preferred activity.
One actually feels a tad guilty owning that the days are passing quite pleasantly if unremarkably.
I have attached a couple of pics taken on our daily walks. Starbank Park is looking particularly Spring like just now. The seaside scene is Newhaven harbour. One of our routes takes us out on a breakwater which gives fine views up the Firth to the bridges.'
(The Blog Editor notes that Peter has omitted to declare his recently acquired addiction to the output of the 12 Triangles Bakery, and that he earns the right to at least half a 12T sticky bun for each loop of his daily tootle (and a whole sticky bun if Sheila isn't looking!).
Also in exile are Neil and Fiona who are getting used an almost silent city, long walks with the dogs, lots of gardening, food deliveries by the box rather than from the supermarket, online Pilates, Skyping and 'Zooming' with friends for coffee and chat, reading and guitar/ukulele practice.
It has been said that Lockdown has felt like Christmas and Birthdays rolled into one for our canine friends who now have all their humans with them all the time (cats are generally less impressed by this intrusion into their personal space). Tego and Abi find some aspects of it a mixed blessing:
"If we weren't under Lockdown, we could have chased that fat pigeon off the grass!
Maybe even caught it."
A number of dogs have now featured in this Blog – what about the rest? Skye? Rannoch? Hairy Harry and his girls? Mabel? What about some news and pics of what you're getting up to with your humans? Send them to fiona@fearnanvillageassociation.com
Fearnan Book Club Review
The Book Club conducted its first virtual meeting this month and April's Review (below) has been compiled by Linda from various emails, a phone call and a conversation across the burn!
Apparently, she tells us, a third of people are reading more since Lockdown.
Most are reading fiction with classics and crime novels proving popular while titles about fictional epidemics such as Albert Camus' The Plague, and The Viral Storm by Nathan D Wolfe have enjoyed increased sales.
Pale Rider: The Spanish Flu of 1918 and How it changed the World by Laura Spinney, an admired science journalist may also be an interesting read at this time.
On a different note, Normal People, a 2018 novel by Sally Rooney is being serialised on BBC 3 starting on 26th April.
Our choice of book for our virtual session in April was Where the Crawdads Sing by Delia Owens, an American author and geologist. The story, which has an intertwining timeline, is set on the North Carolina coast. It is both a murder mystery and love story, eloquently told.
There was unanimous praise for this book which most found to be an enthralling, compelling reading and an amazing narrative. A few initially found it hard to get accustomed to the Southern accent but this didn't detract from the overall enjoyment. We were amazed by the resilience and resourcefulness of the young Kya, the main character, who was abandoned at a young age by her family. We were carried into her world and immersed in her story with its vivid characterisation.
The marsh environment and its creatures influenced her understanding of the world and we followed her development through the story as she grew up and became an author and authority on the flora and fauna of the marsh. We loved the beautiful, detailed descriptions and observations of the marshland and its waterways and beaches, the natural history and the poetry which featured in the book.
We were sadly reminded of prejudices that can exist when someone in a community is different as she was vilified by the young people in the area. The trial brought out the best and worst of the village.
We generally found the ending satisfactory, which has not always been the case with recent reads, although the murder plot itself left too many questions unanswered and seemed unlikely, although perhaps a brilliant twist at the end. We felt that it would make a great film showcasing the wonderful scenery, colourful characters and relationships.
Our choice of book for the next virtual session on Wednesday 13th May is Sleep by C.L. Taylor. It has been described as a gripping psychological thriller full of suspense, action, intrigue and mystery It is set on the Scottish Island of Rum in The Bay View Hotel where one of the guests is a killer but who is it ………..?
Now that everybody has lots of time to read, here are a few chunky, historical lockdown reads currently being read by FVA members.
Liz and Lesley are both reading Hilary Mantel novels, Bring up the Bodies and The Mirror and the Light respectively. The latter, 879 pages long, closes the trilogy covering the final four years of a Cromwell's life. It has been shortlisted for the Women's Prize for Fiction. Alistair has been reading Culloden by Trevor Royle and The King over the Water by Desmond Seward, giving both sides of the Jacobite story.
Jigsaw Show and Tell
We hear that lthere are quite a few people doing jigsaws to help pass the time. If you are one of them, what about sharing your efforts? After all, you spend hours and hours doing the jigsaw, look at the completed picture for a bit – and then you just have to break it up and put it back in the box. So why not share it with everyone?
To start us off, here is the puzzle that Linda and Alistair are doing – an Ordnance Survey Map. And it looks like one to do your head in! Good luck, chaps!
Many thanks to everyone who contributed words and pics to the Blog this week. Please keep them coming to fiona@fearnanvillageassociation.com
The words and pictures on this website are covered by copyright. The copyright of all pictures belongs to the person who took them and similarly, the copyright of the words belongs to the person who wrote them.


Look at how beautiful this apartment is in Discovery Bay (HK) that I found on interior design website, Homedit?! I love the white walls and natural materials used that look to contrast to the bursts of colour around the room from the panels on the walls and the carpet. The space was done by Head Architecture and Design.


text:
Kane Hodder, Dee Wallace and others in new Death House Shots
Posted on: April 21st, 2016
Undoubtedly one of the most hotly anticipated horror films on our radar, self-proclaimed 'Expendables of horror' Death House has just about wrapped principal photography in Philadelphia. To celebrate, here's a bunch of stills, BTS and promo shots.
Directed by Camp Dread director and friend of Scream Harrison Smith, the film is based on a story by Leatherface himself, the late horror icon Gunnar Hansen. The cast is a who's who of horror's last 40 years or so, and includes (deep breath) Dee Wallace, Kane Hodder, Michael Berryman, Barbara Crampton, Adrienne Barbeau, Bill Moseley, Sid Haig, Tom Savini, Debbie Rochon, Bill Oberst Jr. and star of the real I Spit on your Grave, Camille Keaton. Building a cast like this is an astonishing accomplishment, given how in-demand a number of these names are right now.
The plot is a straight-forward one, but ripe with potential for violence: Two federal agents fight their way through nine levels of Hell inside a secret prison known as the Death House. A facility-wide prison break turns their flight into a tour of horrors as they push toward the ultimate evil housed in the lowest depths of the earth.
Fighting their way through a prison populated by the nastiest prisoners on Earth, the agents are played by Cortney Palm (Zombeavers, Silent Night) and Cody Longo (Piranha 3D).


Canada's Volunteer Awards – Deadline February 3, 2017!
Don't miss your chance to bring recognition to someone who is doing important work in your community! Deadline February 3, 2017. The call for nominations for Canada's Volunteer Awards is now open, and CSAM encourages you to nominate a not-for-profit organization, an individual/group of volunteers or a business.
Complete the CMA's Workforce Survey to help plan for future of our health system!
CSAM has a new Office Manager!
The CSAM Board of Directors applauds the BC College of Physicians and Surgeons prescribing guidelines. The CSAM board recognizes the complexity of the situation and looks forward to other regions implementing similar principals.
Holly Raymond and her team were awarded Best Poster at the Closing ceremony of the ISAM & CSAM-SMCA conference in Montreal on October 22, 2016. The Best Poster award this year was People's Choice! Congratulations Holly and team!
During the month of September, Canadians in recovery from addiction join with friends and family to build awareness, challenge societal stigma and celebrate the role that recovery plays in improving the lives of individuals, families, workplaces and communities.


Currently looking for a Registered Nurse to fill a four-month assignment in Tuba City, Arizona. This registered nurse opportunity is working from 7a - 2: 30p in the OR with on call.
Salary: $43.00 per hour. Based on experience, benefit level and traveler status.


Walter, M., & Wartzack, S. (2012). Analysis of the effects of manufacturing-caused deviations and varying operation parameters on operation-depending deviations of systems in motion. In Proceedings of the 12th CIRP Conference on Computer Aided Tolerancing (pp. -). Huddersfield.
Walter, Michael, and Sandro Wartzack. "Analysis of the effects of manufacturing-caused deviations and varying operation parameters on operation-depending deviations of systems in motion." Proceedings of the 12th CIRP Conference on Computer Aided Tolerancing, Huddersfield 2012. -.


We have been in dire need of dressers since we moved to Texas last year. When we built our previous home, we had walk-in closets in every room with built-in drawers and shelves that completely eliminated the need for dressers. Well–that wasn't the case in this house, and I've been trying to track down dressers for each room since we moved in. A few weeks ago, someone gave me this dresser, and even though it wasn't my my style at all, I knew I could give it a dresser makeover and it would be just the thing for my girls' room. Plus…it was free, and who can argue with that? I can make anything work if it's free! ☺It happened to be a laminate surface, which is absolutely possible to paint and use–you just need to do it the right way!
I love it!!! It's perfect in their room! You can see in the before shot that the centers of the drawers were a little different–they had a thick plastic-y type material that I wasn't in love with, and had to think how I was going to cover it up/use it. I thought of several different options, but in the end decided on chalkboard paint, and I'm so glad! It's fun to write what's on each drawer, although my girls are SO embarrassed that the word "underwear" is on there. So…we may have to take it off, lol. I used paint that I already had, and only had to buy the drawer handles, so the total cost was less than $15! Woot woot!!!
1. The dresser was a laminate, which usually requires a primer. I had some leftover white chalk paint (not to be confused with chalkboard paint–they are different! There will be a big post next week revealing my kitchen chairs makeover, and I'll talk a lot more about chalk paint…) and since it sticks to any surface with no sanding or priming (which is quite fabulous in my opinion), I didn't have to prep the surface. If you're not using chalk paint, you MUST ABSOLUTELY use a primer before painting on a laminate surface. The paint will not stick otherwise, and will peel and chip right off. In fact, you need to use a primer that's intended and designed for slick/laminate/glossy surfaces. A good primer will make or break your project…so invest in a good one. Cheap paint? Fine. Use a good primer and it won't matter! Zinsser makes a good one, and I've also used Bulls-eye 1-2-3 and liked both. Zinsser's oil-based primer is awesome–no sanding required–and you can use a latex paint right over it. Roll on your primer, and use a brush in all the corners. I use cheap brushes and rollers that I can throw away after I'm done, so there is very little clean up. You probably want to keep mineral spirits on hand to clean your hands.
2. Once the primer is dry, you need to lightly sand it, to get rid of any drips or bubbles. If you're going to brush your paint on, then I suggest using a higher quality brush–it will reduce the brush strokes. I'm a huge fan of spray paint, because it does go on nice and smooth, so I use it a lot. Invest in a clip-on hand sprayer (about $6 at Home Depot), and it will help the dripping caused by a tired finger. ☺ Put two coats on, letting it dry in between coats.
3. After the paint was dry, I taped off the drawer edges and applied the chalkboard spray paint. I did two coats, letting it dry in between coats. The handles went on next, and I was done!
I love that this was done in less than 48 hours–fast, easy, and FREE!
So…if you're wondering about a piece of laminate furniture in your house, yes–paint it! I've refinished many a piece of furniture either a laminate or slick surface, and it changes the look so incredibly. Brighten it up with a fun color or crisp white…the sky is the limit!
If you're looking for an inexpensive piece of furniture to makeover, check out your local thrift and goodwill stores, and my favorite…the Habitat Re-store. I have no fear when it comes to stopping on the side of the road if I see something with potential. ☺ Some of my favorite things were acquired that way! Check with friends and family…they might also be wanting to get rid of something that they might give to you for free, or for a small amount. It's worth asking!
Hi Kierste :-). Happy New Year! Hope you are all well. Thanks for this post. I have a laminate dresser that is waiting for a makeover — Is the white area chalk paint also?
Love it!! It turned out great!!
Thank you, Crystal! xoxo I'm glad you stopped by and said hello!!
Hi Denise! There have been a lot of people paint their kitchen cabinets with chalk paint and loved it! I don't know specifically if they were laminate, but usually cabinets have a thick finish in them, making them kind of "slick", so it would be similar to a laminate surface in that way. Honestly, if she's on a budget, it's a good option! I think she'll need to decide whether she would rather have it be more time consuming on the front end or back end—either she will be sanding and priming, then spraying on latex paint, or she won't be priming, painting with a brush, then waxing (which can be time intensive). I think the chalk paint would be beautiful, though! I would also check Annie Sloan's site–she has a section just for kitchen cabinets!
I also love the sign above the dresser. What fonts did you use?
I bought that vinyl lettering forever ago, so I'm not sure what the fonts are. I'm so sorry!!


text:
Free Wi-Fi Rental
City Navi
Free Wi-Fi Rental Service
Aug. 29, 2017 UPDATE
Perfect guide for autumn leaves in Kyoto
Off-the-beaten-path autumn leaves spots that are still close to the classic sightseeing spots!
All those famous sightseeing spots are great, but during the autumn leaves season they can get a bit croded. But fear not, there are also many autumn leaves spots in Kyoto that are not as crowded, and often mainly visited by the locals. In this part we have such spots that are not too far from Kyoto Station:
Unryu-in close to Tofuku-ji
Unryu-in, a sub-temple of Sennyu-ji, is a 20-minute walk from Tofuku-ji. It is a small temple inside the precincts of Sennyu-ji. At this temple you can enjoy their garden by seeing it from a round window, or from four square windows on sliding doors. This place is great for those who want to enjoy autumn leaves in peace, because even though the temple is close to Kyoto Station, not that many tourists go to it.
Best time for the autumn leaves: Middle of November to the first part of December.
Hogon-in close to Tenryu-ji
Hogon-in is a sub-temple of the famous Arashiyama sightseeing spot, Tenryu-ji Temple. Normally Hogon-in is not open to the public, but during the cherry blossom and autumn leaves season the temple welcomes everyone to its main building and garden, though you do need to pay an admission fee. Their stroll garden with its rocks, 300 maple trees, and the beautiful moss, all make the garden look incredibly beautiful. The garden is small but the shades of the autumn leaves are rich, and we are sure you are going to leave the temple satisfied.
Rokuo-in close to Randen Arashiyama Station
This is a hidden autumn leaves spot in Arashiyama. To get here, you need to take a Randen tram from Arashiyama Station and get off at Rokuoin Station, from where the temple is a 5-minute walk away. The temple is located in a quiet residential area, and after you go through the temple's main gate you get to see a narrow path to the temple lined with maple trees. This little temple is usually not featured on guidebooks, and if you go to it on a weekday morning, you stand a chance of getting the whole temple to yourself. Besides the main path to the temple, the dry rock garden which incorporates the mountains of Arashiyama into its design is also worth a see.
Honen-in close to Ginkaku-ji
Honen-in is some way from Philosopher's Path, right by the World Heritage Site of Ginkaku-ji. It may not be as big and stately as some bigger temples, but the moss-covered thatched roof of its gate has a nice, rustic feeling to it. After you go through the gate, you get to see the white piles of sand known as Byakusadan and the beautiful red and yellow autumn leaves together. After the autumn leaves start falling down, they pile on the white sand making the temple feel melancholic but beautiful. Eikan-do and Ginkaku-ji are also close, but Honen-in is not crowded, which is why we recommend it.
Philosopher's Walk
The Philosopher's Walk may be more famous for cherry blossoms, but it is also very beautiful when it's covered by vivid autumn leaves. Many sightseeing spots are easily accessible from this path, like Eikan-do, Nanzen-ji, and Ginkaku-ji, so how about enjoying the autumn of Kyoto while you think of the meaning of life on the Philosopher's Walk?
Entoku-in close to Kodai-ji
Entoku-in is a sub-temple of the famous Kodai-ji in the Higashiyama area, and the temple has two dry rock gardens, Nantei and Hokutei, and at the temple you can sit down and look at the beautiful gardens and the autumn leaves. They also sell a ticket for which you can go to both Entoku-in and Kodai-ji, which you should get if you go to both of them. There is also an illumination even at night at the temple which paints the garden and the autumn leaves in a mysterious light.
All of the places here are close to famous sightseeing spots, but still not overrun by tourists. These spots are great for those who have been to all of the famous autumn leaves spots, or for those who want to avoid the crowds. Of course, because these spots are close to the famous ones, you could go to both of them.
Read Other Parts
Part 1Classic autumn leaves spot under 30-minutes train ride away from Kyoto Station!
Part 2More classic spots around an hour away from Kyoto Station
Part 3Off-the-beaten-path autumn leaves spots that are still close to the classic sightseeing spots!
Part 4Enjoy autumn leaves in places surrounded by nature over an hour's trip from Kyoto Station!
Back to the top of this feature
View All Feature Articles
Sign up to Sharing Kyoto
You need to sign up / log in to add more destinations to your list
- By registering/ logging in, you agree to Sharing Kyoto's Cookie Policy & Privacy Policy.
Already a Sharing Kyoto member ?
In-house and third party cookies are used to improve services and user experience. By continuing to use the website, you agree that cookies will be set on your device. Get more information on our cookie policy here.
Sharing Kyoto
Sharing Kyoto's feature articles
Enjoy Kyoto
Copyright © agex communications Inc. All Rights Reserved.
What are you looking for? Choose a category below.
Restaurants in Kyoto
Shopping in Kyoto
Events in Kyoto


157 Boston College students are under investigation for staging a die-in protest in Bapst Library. Boston College, which recently punished students for harmlessly laying down and practicing their right to protest in St. Mary's, has been on red alert lately.
"But I digress," concluded Bunderson.
Bunderson promised he will be keeping a vigilant eye out for other such protests, and hints that he'd even "break down a few doors in the sake of justice" to make sure students aren't staging die-in protests in their own beds.


I was on a trip to Turkey last week, so I used a classic strip, in case you were wondering why there was no cartoon. I'll be posting more about my adventures soon.
I found out about the ACA ruling in the Houston airport shortly after arriving back in the US. Not a bad way to re-enter the country! Of course, I would have preferred not to have had to worry about keeping my health insurance in the first place.
As a wide-footed, cranky-toed woman, I have always been incapable of wearing high heels, and I've had doctors instruct me not to wear them. Of course, this sometimes makes me the least-fancy woman in the room.
The Trans-Pacific Partnership, or "TPP," may sound like a boring subject to some Americans, but the details are alarming. Leaked documents show that the agreement would allow multinationals to sue any country whose laws they claim stand in the way of profits. These companies' challenges to environmental regulations, worker safety laws, and other protections, would be hashed out in private tribunals that operate outside of established legal systems. Obama has staunchly defended the secret agreement and is pushing for fast-track approval, alienating many in his own party. Which makes me wonder: WTF?
Paul Krugman's column from a couple weeks ago explains why concerns about threats to national, state, or local laws are not unfounded. Canada's finance minister is challenging the Volcker Rule under NAFTA. Jim Hightower also has more on the Investor-State Dispute Settlement process, and how it's being used by Phillip Morris to challenge anti-smoking laws in Australia and Uruguay.
Gigantic corporations already have more than enough power. Obama shouldn't be pushing to give them even more, or belittling those who argue otherwise.


Mrs. Abike Dabiri - Erewa, the Senior Special Assistant to President Muhammadu Buhari on Diaspora Affairs has asked South African authorities to find a solution to the rampant murder of Nigerians in the country. She spoke in reaction to the gruesome murder of Clement Nwaogu, a Nigerian who was roasted to death in Rustenburg, South Africa over the weekend.
Mrs. Abike Dabiri - Erewa, the Senior Special Assistant to President Muhammadu Buhari on Diaspora Affairs has asked South African authorities to find a solution to the rampant murder of Nigerians in the country.
She spoke in reaction to the gruesome murder of Clement Nwaogu, a Nigerian who was roasted to death in Rustenburg, South Africa over the weekend.
In a statement released in Abuja, the presidential aide urged the authorities in South Africa to proffer solutions to the incessant killings of Nigerians in the former apartheid enclave.
She also asked Nigerians residing abroad to shun any criminal activities and be obedient to laws of their host countries.
Dabiri also stated that 14 Nigerians who were arrested for protesting the killing of a Nigerian were still being held in a South Africa prison.
She said, "Just a few days ago, on April 17, the case came up in court. There was so much tension that even the Nigerian lawyers representing the Nigerians had to be escorted to court by Diplomatic police.
"Four South African policemen are currently in court for allegedly killing and maltreating Nigerians with embassy officials constantly present in court for the hearings. This is the first time this will be happening.


text:
Greg Stella (Curitiba, 1986) é um roteirista de quadrinhos brasileiro. É autor do fanzine Nas Dobras do Mundo. Escreveu o roteiro dos romances gráficos Meu Pai É um Homem da Montanha (independente, 2015, assinando como Gregório Bert), Eles Estão por Aí (Todavia, 2018) e Sob o Solo (Pipoca & Nanquim, 2019), todos com ilustrações de sua esposa, Bianca Pinheiro.

Pelo romance gráfico Eles Estão por Aí, Greg e Bianca foram indicados ao Prêmio Jabuti de histórias em quadrinhos em 2019, ficaram em terceiro lugar na edição de 2019 do Prêmio Grampo e ganharam o Prêmio APCA de Literatura de 2018 na categoria "Infantil / Juvenil / Quadrinhos" (a despeito do livro não ser voltado ao público infantil).

Ligações externas

Homens ganhadores do Prêmio APCA de Literatura
Roteiristas de histórias em quadrinhos do Brasil

redpajama_set_name: RedPajamaWikipedia


Landmark Tower 81 is considered as a connection of architectural trend and traditional culture to meet luxury needs of a modern urban area.
Landmark Tower 81 is Vietnam's first project lies into top world's 10 skyscrapers, which is built in luxurious style, especially is business centers, hotels and apartments.
Trade Center towers inside is shopping paradise of many world's famous fashion brands as Louis Vuitton, Gucci, Hermes….
Located on floors form 42 to 76 is a Vinpearl 5-star hotel, which is inspired from Park Hyatt Shanghai – the tallest building in Shanghai.
This is a super-luxury hotel belongs to resort system of Vinpearl, this is an ideal place to organize conferences, seminars… In addition, this place also attracts many wedding events with many celebrities and businessmen.