2012-08-10 19:28:34 +00:00
|
|
|
#include "GuiTheme.h"
|
|
|
|
#include "../MathExp.h"
|
|
|
|
#include <iostream>
|
2012-08-14 01:27:39 +00:00
|
|
|
#include "GuiGameList.h"
|
2012-08-10 19:28:34 +00:00
|
|
|
#include "GuiImage.h"
|
2012-08-11 04:17:52 +00:00
|
|
|
#include <boost/filesystem.hpp>
|
2012-08-13 18:32:53 +00:00
|
|
|
#include <sstream>
|
2012-09-15 21:24:33 +00:00
|
|
|
#include "../Renderer.h"
|
2012-08-13 18:32:53 +00:00
|
|
|
|
2012-10-17 18:21:56 +00:00
|
|
|
unsigned int GuiTheme::getPrimaryColor() { return mListPrimaryColor; }
|
|
|
|
unsigned int GuiTheme::getSecondaryColor() { return mListSecondaryColor; }
|
|
|
|
unsigned int GuiTheme::getSelectorColor() { return mListSelectorColor; }
|
|
|
|
unsigned int GuiTheme::getDescColor() { return mDescColor; }
|
|
|
|
unsigned int GuiTheme::getFastSelectColor() { return mFastSelectColor; }
|
2012-08-13 18:32:53 +00:00
|
|
|
bool GuiTheme::getHeaderHidden() { return mHideHeader; }
|
|
|
|
bool GuiTheme::getDividersHidden() { return mHideDividers; }
|
2012-08-14 01:27:39 +00:00
|
|
|
bool GuiTheme::getListCentered() { return mListCentered; }
|
2012-09-15 21:24:33 +00:00
|
|
|
float GuiTheme::getListOffsetX() { return mListOffsetX; }
|
|
|
|
float GuiTheme::getListTextOffsetX() { return mListTextOffsetX; }
|
|
|
|
|
2012-10-17 18:21:56 +00:00
|
|
|
unsigned int GuiTheme::getSelectedTextColor() { return mListSelectedColor; }
|
2012-10-01 03:29:55 +00:00
|
|
|
|
2012-10-07 22:59:20 +00:00
|
|
|
GuiBoxData GuiTheme::getBoxData() { return mBoxData; }
|
|
|
|
|
2012-10-13 18:29:53 +00:00
|
|
|
Sound* GuiTheme::getMenuScrollSound() { return &mMenuScrollSound; }
|
2012-10-13 20:05:43 +00:00
|
|
|
Sound* GuiTheme::getMenuSelectSound() { return &mMenuSelectSound; }
|
|
|
|
Sound* GuiTheme::getMenuBackSound() { return &mMenuBackSound; }
|
|
|
|
Sound* GuiTheme::getMenuOpenSound() { return &mMenuOpenSound; }
|
2012-10-13 18:29:53 +00:00
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
float GuiTheme::getGameImageOffsetX() { return mGameImageOffsetX; }
|
|
|
|
float GuiTheme::getGameImageOffsetY() { return mGameImageOffsetY; }
|
|
|
|
float GuiTheme::getGameImageWidth() { return mGameImageWidth; }
|
|
|
|
float GuiTheme::getGameImageHeight() { return mGameImageHeight; }
|
|
|
|
float GuiTheme::getGameImageOriginX() { return mGameImageOriginX; }
|
|
|
|
float GuiTheme::getGameImageOriginY() { return mGameImageOriginY; }
|
|
|
|
|
2012-10-25 17:36:30 +00:00
|
|
|
std::string GuiTheme::getImageNotFoundPath() { return mImageNotFoundPath; }
|
|
|
|
|
2012-10-31 14:46:06 +00:00
|
|
|
Font* GuiTheme::getListFont()
|
|
|
|
{
|
|
|
|
if(mListFont == NULL)
|
|
|
|
return Renderer::getDefaultFont(Renderer::MEDIUM);
|
|
|
|
else
|
|
|
|
return mListFont;
|
|
|
|
}
|
|
|
|
|
|
|
|
Font* GuiTheme::getDescriptionFont()
|
|
|
|
{
|
|
|
|
if(mDescFont == NULL)
|
|
|
|
return Renderer::getDefaultFont(Renderer::SMALL);
|
|
|
|
else
|
|
|
|
return mDescFont;
|
|
|
|
}
|
|
|
|
|
2012-08-10 19:28:34 +00:00
|
|
|
GuiTheme::GuiTheme(std::string path)
|
|
|
|
{
|
2012-10-31 14:46:06 +00:00
|
|
|
mListFont = NULL;
|
|
|
|
mDescFont = NULL;
|
|
|
|
|
2012-08-14 01:27:39 +00:00
|
|
|
setDefaults();
|
2012-08-13 18:32:53 +00:00
|
|
|
|
2012-08-10 19:28:34 +00:00
|
|
|
if(!path.empty())
|
|
|
|
readXML(path);
|
|
|
|
}
|
|
|
|
|
|
|
|
GuiTheme::~GuiTheme()
|
|
|
|
{
|
|
|
|
deleteComponents();
|
|
|
|
}
|
|
|
|
|
2012-08-14 01:27:39 +00:00
|
|
|
void GuiTheme::setDefaults()
|
|
|
|
{
|
2012-10-17 18:21:56 +00:00
|
|
|
mListPrimaryColor = 0x0000FFFF;
|
|
|
|
mListSecondaryColor = 0x00FF00FF;
|
|
|
|
mListSelectorColor = 0x000000FF;
|
|
|
|
mListSelectedColor = 0xFF0000FF;
|
|
|
|
mDescColor = 0x0000FFFF;
|
|
|
|
mFastSelectColor = 0xFF0000FF;
|
2012-08-14 01:27:39 +00:00
|
|
|
mHideHeader = false;
|
|
|
|
mHideDividers = false;
|
|
|
|
mListCentered = true;
|
2012-09-15 21:24:33 +00:00
|
|
|
|
|
|
|
mListOffsetX = 0.5;
|
|
|
|
mListTextOffsetX = 0.005;
|
2012-10-13 23:37:51 +00:00
|
|
|
|
|
|
|
mGameImageOriginX = 0.5;
|
|
|
|
mGameImageOriginY = 0;
|
|
|
|
mGameImageOffsetX = mListOffsetX / 2;
|
2012-10-24 15:28:37 +00:00
|
|
|
mGameImageOffsetY = (float)Renderer::getDefaultFont(Renderer::LARGE)->getHeight() / Renderer::getScreenHeight();
|
2012-10-13 23:51:35 +00:00
|
|
|
mGameImageWidth = mListOffsetX;
|
2012-10-13 23:37:51 +00:00
|
|
|
mGameImageHeight = 0;
|
2012-10-07 22:59:20 +00:00
|
|
|
|
|
|
|
mBoxData.backgroundPath = "";
|
|
|
|
mBoxData.backgroundTiled = false;
|
|
|
|
mBoxData.horizontalPath = "";
|
|
|
|
mBoxData.horizontalTiled = false;
|
|
|
|
mBoxData.verticalPath = "";
|
|
|
|
mBoxData.verticalTiled = false;
|
|
|
|
mBoxData.cornerPath = "";
|
2012-10-13 18:29:53 +00:00
|
|
|
|
|
|
|
mMenuScrollSound.loadFile("");
|
2012-10-13 20:05:43 +00:00
|
|
|
mMenuSelectSound.loadFile("");
|
|
|
|
mMenuBackSound.loadFile("");
|
|
|
|
mMenuOpenSound.loadFile("");
|
2012-10-25 17:36:30 +00:00
|
|
|
|
|
|
|
mImageNotFoundPath = "";
|
2012-10-31 14:46:06 +00:00
|
|
|
|
|
|
|
if(mListFont != NULL)
|
|
|
|
{
|
|
|
|
delete mListFont;
|
|
|
|
mListFont = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(mDescFont != NULL)
|
|
|
|
{
|
|
|
|
delete mDescFont;
|
|
|
|
mDescFont = NULL;
|
|
|
|
}
|
2012-08-14 01:27:39 +00:00
|
|
|
}
|
|
|
|
|
2012-08-10 19:28:34 +00:00
|
|
|
void GuiTheme::deleteComponents()
|
|
|
|
{
|
|
|
|
for(unsigned int i = 0; i < mComponentVector.size(); i++)
|
|
|
|
{
|
|
|
|
delete mComponentVector.at(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
mComponentVector.clear();
|
2012-08-11 04:17:52 +00:00
|
|
|
|
|
|
|
clearChildren();
|
2012-08-10 19:28:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GuiTheme::readXML(std::string path)
|
|
|
|
{
|
2012-08-12 14:43:09 +00:00
|
|
|
if(mPath == path)
|
|
|
|
return;
|
|
|
|
|
2012-08-14 01:27:39 +00:00
|
|
|
setDefaults();
|
2012-08-10 19:28:34 +00:00
|
|
|
deleteComponents();
|
|
|
|
|
2012-08-11 04:17:52 +00:00
|
|
|
mPath = path;
|
|
|
|
|
|
|
|
if(path.empty())
|
|
|
|
return;
|
|
|
|
|
2012-10-05 13:44:18 +00:00
|
|
|
//std::cout << "Loading theme \"" << path << "\"...\n";
|
2012-08-10 19:28:34 +00:00
|
|
|
|
|
|
|
pugi::xml_document doc;
|
|
|
|
pugi::xml_parse_result result = doc.load_file(path.c_str());
|
|
|
|
|
|
|
|
if(!result)
|
|
|
|
{
|
|
|
|
std::cerr << "Error parsing theme \"" << path << "\"!\n";
|
|
|
|
std::cerr << " " << result.description() << "\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
pugi::xml_node root = doc.child("theme");
|
|
|
|
|
2012-08-13 18:32:53 +00:00
|
|
|
//load non-component theme stuff
|
2012-09-15 21:24:33 +00:00
|
|
|
mListPrimaryColor = resolveColor(root.child("listPrimaryColor").text().get(), mListPrimaryColor);
|
|
|
|
mListSecondaryColor = resolveColor(root.child("listSecondaryColor").text().get(), mListSecondaryColor);
|
|
|
|
mListSelectorColor = resolveColor(root.child("listSelectorColor").text().get(), mListSelectorColor);
|
2012-10-17 18:21:56 +00:00
|
|
|
mListSelectedColor = resolveColor(root.child("listSelectedColor").text().get(), mListPrimaryColor);
|
2012-09-15 21:24:33 +00:00
|
|
|
mDescColor = resolveColor(root.child("descColor").text().get(), mDescColor);
|
2012-10-10 13:51:48 +00:00
|
|
|
mFastSelectColor = resolveColor(root.child("fastSelectColor").text().get(), mFastSelectColor);
|
2012-08-13 18:32:53 +00:00
|
|
|
mHideHeader = root.child("hideHeader");
|
|
|
|
mHideDividers = root.child("hideDividers");
|
|
|
|
|
2012-10-07 22:59:20 +00:00
|
|
|
//GuiBox theming data
|
|
|
|
mBoxData.backgroundPath = expandPath(root.child("boxBackground").text().get());
|
|
|
|
mBoxData.backgroundTiled = root.child("boxBackgroundTiled");
|
|
|
|
mBoxData.horizontalPath = expandPath(root.child("boxHorizontal").text().get());
|
|
|
|
mBoxData.horizontalTiled = root.child("boxHorizontalTiled");
|
|
|
|
mBoxData.verticalPath = expandPath(root.child("boxVertical").text().get());
|
|
|
|
mBoxData.verticalTiled = root.child("boxVerticalTiled");
|
|
|
|
mBoxData.cornerPath = expandPath(root.child("boxCorner").text().get());
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//list stuff
|
|
|
|
mListCentered = !root.child("listLeftAlign");
|
2012-09-15 21:24:33 +00:00
|
|
|
mListOffsetX = strToFloat(root.child("listOffsetX").text().get(), mListOffsetX);
|
|
|
|
mListTextOffsetX = strToFloat(root.child("listTextOffsetX").text().get(), mListTextOffsetX);
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//game image stuff
|
|
|
|
std::string artPos = root.child("gameImagePos").text().get();
|
|
|
|
std::string artDim = root.child("gameImageDim").text().get();
|
|
|
|
std::string artOrigin = root.child("gameImageOrigin").text().get();
|
|
|
|
|
|
|
|
std::string artPosX, artPosY, artWidth, artHeight, artOriginX, artOriginY;
|
|
|
|
splitString(artPos, ' ', &artPosX, &artPosY);
|
|
|
|
splitString(artDim, ' ', &artWidth, &artHeight);
|
|
|
|
splitString(artOrigin, ' ', &artOriginX, &artOriginY);
|
|
|
|
|
|
|
|
mGameImageOffsetX = resolveExp(artPosX, mGameImageOffsetX);
|
|
|
|
mGameImageOffsetY = resolveExp(artPosY, mGameImageOffsetY);
|
|
|
|
mGameImageWidth = resolveExp(artWidth, mGameImageWidth);
|
|
|
|
mGameImageHeight = resolveExp(artHeight, mGameImageHeight);
|
|
|
|
mGameImageOriginX = resolveExp(artOriginX, mGameImageOriginX);
|
|
|
|
mGameImageOriginY = resolveExp(artOriginY, mGameImageOriginY);
|
|
|
|
|
2012-10-25 17:36:30 +00:00
|
|
|
mImageNotFoundPath = expandPath(root.child("gameImageNotFound").text().get());
|
|
|
|
|
2012-10-13 18:29:53 +00:00
|
|
|
//sounds
|
2012-10-13 20:05:43 +00:00
|
|
|
mMenuScrollSound.loadFile(expandPath(root.child("menuScrollSound").text().get()));
|
|
|
|
mMenuSelectSound.loadFile(expandPath(root.child("menuSelectSound").text().get()));
|
|
|
|
mMenuBackSound.loadFile(expandPath(root.child("menuBackSound").text().get()));
|
|
|
|
mMenuOpenSound.loadFile(expandPath(root.child("menuOpenSound").text().get()));
|
2012-10-13 18:29:53 +00:00
|
|
|
|
2012-10-25 17:36:30 +00:00
|
|
|
//fonts
|
2012-10-31 14:46:06 +00:00
|
|
|
mListFont = resolveFont(root.child("listFont"), Font::getDefaultPath(), Renderer::getDefaultFont(Renderer::MEDIUM)->getSize());
|
|
|
|
mDescFont = resolveFont(root.child("descriptionFont"), Font::getDefaultPath(), Renderer::getDefaultFont(Renderer::SMALL)->getSize());
|
2012-10-25 17:36:30 +00:00
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//actually read the components
|
2012-09-15 21:24:33 +00:00
|
|
|
createComponentChildren(root, this);
|
2012-08-10 19:28:34 +00:00
|
|
|
}
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//recursively creates components (with proper parenting)
|
2012-09-15 21:24:33 +00:00
|
|
|
void GuiTheme::createComponentChildren(pugi::xml_node node, GuiComponent* parent)
|
|
|
|
{
|
|
|
|
for(pugi::xml_node data = node.child("component"); data; data = data.next_sibling("component"))
|
|
|
|
{
|
|
|
|
GuiComponent* nextComp = createElement(data, parent);
|
|
|
|
|
|
|
|
if(nextComp)
|
|
|
|
createComponentChildren(data, nextComp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//takes an XML element definition and creates an object from it
|
2012-08-10 19:28:34 +00:00
|
|
|
GuiComponent* GuiTheme::createElement(pugi::xml_node data, GuiComponent* parent)
|
|
|
|
{
|
|
|
|
std::string type = data.child("type").text().get();
|
|
|
|
|
|
|
|
if(type == "image")
|
|
|
|
{
|
2012-08-11 04:17:52 +00:00
|
|
|
std::string path = expandPath(data.child("path").text().get());
|
|
|
|
|
|
|
|
if(!boost::filesystem::exists(path))
|
|
|
|
{
|
|
|
|
std::cerr << "Error - theme image \"" << path << "\" does not exist.\n";
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-08-10 19:28:34 +00:00
|
|
|
std::string pos = data.child("pos").text().get();
|
|
|
|
std::string dim = data.child("dim").text().get();
|
2012-08-13 18:32:53 +00:00
|
|
|
std::string origin = data.child("origin").text().get();
|
|
|
|
|
|
|
|
bool tiled = data.child("tiled");
|
2012-08-10 19:28:34 +00:00
|
|
|
|
|
|
|
//split position and dimension information
|
2012-08-13 18:32:53 +00:00
|
|
|
std::string posX, posY;
|
|
|
|
splitString(pos, ' ', &posX, &posY);
|
|
|
|
|
|
|
|
std::string dimW, dimH;
|
|
|
|
splitString(dim, ' ', &dimW, &dimH);
|
2012-08-10 19:28:34 +00:00
|
|
|
|
2012-08-13 18:32:53 +00:00
|
|
|
std::string originX, originY;
|
|
|
|
splitString(origin, ' ', &originX, &originY);
|
2012-08-10 19:28:34 +00:00
|
|
|
|
|
|
|
//resolve to pixels from percentages/variables
|
|
|
|
int x = resolveExp(posX) * Renderer::getScreenWidth();
|
|
|
|
int y = resolveExp(posY) * Renderer::getScreenHeight();
|
|
|
|
int w = resolveExp(dimW) * Renderer::getScreenWidth();
|
|
|
|
int h = resolveExp(dimH) * Renderer::getScreenHeight();
|
|
|
|
|
2012-08-15 06:18:06 +00:00
|
|
|
float ox = strToFloat(originX);
|
|
|
|
float oy = strToFloat(originY);
|
2012-08-13 18:32:53 +00:00
|
|
|
|
|
|
|
GuiImage* comp = new GuiImage(x, y, "", w, h, true);
|
|
|
|
comp->setOrigin(ox, oy);
|
|
|
|
comp->setTiling(tiled);
|
|
|
|
comp->setImage(path);
|
|
|
|
|
2012-08-10 19:28:34 +00:00
|
|
|
parent->addChild(comp);
|
|
|
|
mComponentVector.push_back(comp);
|
|
|
|
return comp;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
std::cerr << "Theme component type \"" << type << "\" unknown!\n";
|
2012-08-10 19:28:34 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//expands a file path (./ becomes the directory of this theme file, ~/ becomes $HOME/)
|
2012-08-11 04:17:52 +00:00
|
|
|
std::string GuiTheme::expandPath(std::string path)
|
|
|
|
{
|
|
|
|
if(path[0] == '~')
|
|
|
|
path = getenv("HOME") + path.substr(1, path.length() - 1);
|
|
|
|
else if(path[0] == '.')
|
|
|
|
path = boost::filesystem::path(mPath).parent_path().string() + path.substr(1, path.length() - 1);
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//takes a string containing a mathematical expression (possibly including variables) and resolves it to a float value
|
|
|
|
float GuiTheme::resolveExp(std::string str, float defaultVal)
|
2012-08-10 19:28:34 +00:00
|
|
|
{
|
2012-10-13 23:37:51 +00:00
|
|
|
if(str.empty())
|
|
|
|
return defaultVal;
|
|
|
|
|
2012-08-10 19:28:34 +00:00
|
|
|
MathExp exp;
|
|
|
|
exp.setExpression(str);
|
|
|
|
|
|
|
|
//set variables
|
2012-10-24 15:28:37 +00:00
|
|
|
exp.setVariable("headerHeight", Renderer::getDefaultFont(Renderer::LARGE)->getHeight() / Renderer::getScreenHeight());
|
2012-10-13 23:37:51 +00:00
|
|
|
exp.setVariable("infoWidth", mListOffsetX);
|
2012-08-10 19:28:34 +00:00
|
|
|
|
2012-08-11 04:17:52 +00:00
|
|
|
return exp.eval();
|
2012-08-10 19:28:34 +00:00
|
|
|
}
|
2012-08-13 18:32:53 +00:00
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//takes a string of hex and resolves it to an integer
|
2012-10-17 18:21:56 +00:00
|
|
|
unsigned int GuiTheme::resolveColor(std::string str, unsigned int defaultColor)
|
2012-08-13 18:32:53 +00:00
|
|
|
{
|
|
|
|
if(str.empty())
|
|
|
|
return defaultColor;
|
|
|
|
|
2012-10-17 18:21:56 +00:00
|
|
|
if(str.length() != 6 && str.length() != 8)
|
|
|
|
{
|
|
|
|
std::cerr << "Error - color \"" << str << "\" is not a valid hex color! Must be 6 or 8 characters.\n";
|
|
|
|
return defaultColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
//if there's no alpha specified, assume FF
|
|
|
|
if(str.length() == 6)
|
|
|
|
str += "FF";
|
|
|
|
|
|
|
|
unsigned int ret;
|
2012-08-13 18:32:53 +00:00
|
|
|
std::stringstream ss;
|
|
|
|
ss << std::hex << str;
|
|
|
|
ss >> ret;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//splits a string in two at the first instance of the delimiter
|
2012-08-13 18:32:53 +00:00
|
|
|
void GuiTheme::splitString(std::string str, char delim, std::string* before, std::string* after)
|
|
|
|
{
|
|
|
|
if(str.empty())
|
|
|
|
return;
|
|
|
|
|
|
|
|
size_t split = str.find(delim);
|
2012-10-13 23:37:51 +00:00
|
|
|
if(split != std::string::npos)
|
|
|
|
{
|
|
|
|
*before = str.substr(0, split);
|
|
|
|
*after = str.substr(split + 1, str.length() - split - 1);
|
|
|
|
}else{
|
|
|
|
std::cerr << " Error: tried to splt string \"" << str << "\" with delimiter '" << delim << "', but delimiter was not found!\n";
|
|
|
|
}
|
2012-08-13 18:32:53 +00:00
|
|
|
}
|
|
|
|
|
2012-10-13 23:37:51 +00:00
|
|
|
//converts a string to a float
|
2012-09-15 21:24:33 +00:00
|
|
|
float GuiTheme::strToFloat(std::string str, float defaultVal)
|
2012-08-13 18:32:53 +00:00
|
|
|
{
|
|
|
|
if(str.empty())
|
2012-09-15 21:24:33 +00:00
|
|
|
return defaultVal;
|
2012-08-13 18:32:53 +00:00
|
|
|
|
2012-08-15 06:18:06 +00:00
|
|
|
float ret;
|
2012-08-13 18:32:53 +00:00
|
|
|
std::stringstream ss;
|
|
|
|
ss << str;
|
|
|
|
ss >> ret;
|
|
|
|
return ret;
|
|
|
|
}
|
2012-10-25 17:36:30 +00:00
|
|
|
|
2012-10-31 14:46:06 +00:00
|
|
|
Font* GuiTheme::resolveFont(pugi::xml_node node, std::string defaultPath, unsigned int defaultSize)
|
2012-10-25 17:36:30 +00:00
|
|
|
{
|
|
|
|
if(!node)
|
2012-10-31 14:46:06 +00:00
|
|
|
return NULL;
|
2012-10-25 17:36:30 +00:00
|
|
|
|
|
|
|
std::string path = expandPath(node.child("path").text().get());
|
2012-10-31 14:46:06 +00:00
|
|
|
unsigned int size = (unsigned int)(strToFloat(node.child("size").text().get()) * Renderer::getScreenHeight());
|
|
|
|
|
|
|
|
if(!boost::filesystem::exists(path))
|
|
|
|
{
|
|
|
|
path = defaultPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(size == 0)
|
|
|
|
{
|
|
|
|
size = defaultSize;
|
|
|
|
}
|
2012-10-25 17:36:30 +00:00
|
|
|
|
|
|
|
return new Font(path, size);
|
|
|
|
}
|