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