1/* $Id$ $Revision$ */
2/* vim:set shiftwidth=4 ts=8: */
3
4/*************************************************************************
5 * Copyright (c) 2011 AT&T Intellectual Property
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors: See CVS logs. Details at http://www.graphviz.org/
12 *************************************************************************/
13
14/*
15 * textlayout engine wrapper
16 */
17
18#include "config.h"
19
20#include "const.h"
21#include "gvplugin_textlayout.h"
22#include "gvcint.h"
23#include "gvcproc.h"
24
25int gvtextlayout_select(GVC_t * gvc)
26{
27 gvplugin_available_t *plugin;
28 gvplugin_installed_t *typeptr;
29
30 plugin = gvplugin_load(gvc, API_textlayout, "textlayout");
31 if (plugin) {
32 typeptr = plugin->typeptr;
33 gvc->textlayout.engine = (gvtextlayout_engine_t *) (typeptr->engine);
34 return GVRENDER_PLUGIN; /* FIXME - need more suitable success code */
35 }
36 return NO_SUPPORT;
37}
38
39boolean gvtextlayout(GVC_t *gvc, textspan_t *span, char **fontpath)
40{
41 gvtextlayout_engine_t *gvte = gvc->textlayout.engine;
42
43 if (gvte && gvte->textlayout)
44 return gvte->textlayout(span, fontpath);
45 return FALSE;
46}
47