From 9e6940621b58a68929e508c529301bc347db9f66 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Tue, 12 Jun 2012 20:48:39 +0800 Subject: [PATCH] add getFontFace in cre.cpp and credocument.lua also move self.font_face to readerfont module --- cre.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cre.cpp b/cre.cpp index e994638a4..c2fe620da 100644 --- a/cre.cpp +++ b/cre.cpp @@ -174,6 +174,14 @@ static int getFontSize(lua_State *L) { return 1; } +static int getFontFace(lua_State *L) { + CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); + + lua_pushstring(L, doc->text_view->getDefaultFontFace().c_str()); + + return 1; +} + /* * helper function for getTableOfContent() */ @@ -455,6 +463,7 @@ static const struct luaL_Reg credocument_meth[] = { {"getCurrentXPointer", getCurrentXPointer}, {"getFullHeight", getFullHeight}, {"getFontSize", getFontSize}, + {"getFontFace", getFontFace}, {"getToc", getTableOfContent}, /*--- set methods ---*/ {"setFontFace", setFontFace},