Example #1
0
File: cawc.c Project: Roger/caw
static PyObject *
_pango_cairo_create_layout(PyObject *self, PyObject *args)
{
    cairo_t * cairo;
    PangoLayout *layout;

    if (!PyArg_ParseTuple(args, "l", &cairo))
        return NULL;


    layout = pango_cairo_create_layout(cairo);

    printf("Resolution: %f\n", pango_cairo_context_get_resolution(pango_layout_get_context(layout)));

    return Py_BuildValue("l", layout);
}
static double
pango_cairo_core_text_font_map_get_resolution_core_text (PangoCoreTextFontMap *ctfontmap,
                                                         PangoContext         *context)
{
  PangoCairoCoreTextFontMap *cafontmap = PANGO_CAIRO_CORE_TEXT_FONT_MAP (ctfontmap);
  double dpi;

  if (context)
    {
      dpi = pango_cairo_context_get_resolution (context);

      if (dpi <= 0)
        dpi = cafontmap->dpi;
    }
  else
    dpi = cafontmap->dpi;

  return dpi;
}