mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 07:39:41 +00:00
Merge branch 'fonts' into 'master'
Enhance a way to setup fonts and layout files See merge request OpenMW/openmw!2112
This commit is contained in:
commit
40cab76de5
120 changed files with 605 additions and 266 deletions
|
@ -145,6 +145,8 @@
|
|||
Feature #4297: Implement APPLIED_ONCE flag for magic effects
|
||||
Feature #4414: Handle duration of EXTRA SPELL magic effect
|
||||
Feature #4595: Unique object identifier
|
||||
Feature #4974: Overridable MyGUI layout
|
||||
Feature #4975: Built-in TrueType fonts
|
||||
Feature #5198: Implement "Magic effect expired" event
|
||||
Feature #5454: Clear active spells from actor when he disappears from scene
|
||||
Feature #5489: MCP: Telekinesis fix for activators
|
||||
|
|
|
@ -921,7 +921,6 @@ elseif(NOT APPLE)
|
|||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/CHANGELOG.md" DESTINATION "." RENAME "CHANGELOG.txt")
|
||||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/README.md" DESTINATION "." RENAME "README.txt")
|
||||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/LICENSE" DESTINATION "." RENAME "LICENSE.txt")
|
||||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/mygui/DejaVuFontLicense.txt" DESTINATION ".")
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/defaults.bin" DESTINATION ".")
|
||||
INSTALL(FILES "${INSTALL_SOURCE}/gamecontrollerdb.txt" DESTINATION ".")
|
||||
|
||||
|
@ -1023,9 +1022,6 @@ elseif(NOT APPLE)
|
|||
INSTALL(PROGRAMS "${INSTALL_SOURCE}/openmw-bulletobjecttool" DESTINATION "${BINDIR}" )
|
||||
ENDIF(BUILD_BULLETOBJECTTOOL)
|
||||
|
||||
# Install licenses
|
||||
INSTALL(FILES "files/mygui/DejaVuFontLicense.txt" DESTINATION "${LICDIR}" )
|
||||
|
||||
# Install icon and desktop file
|
||||
INSTALL(FILES "${OpenMW_BINARY_DIR}/org.openmw.launcher.desktop" DESTINATION "${DATAROOTDIR}/applications" COMPONENT "openmw")
|
||||
INSTALL(FILES "${OpenMW_SOURCE_DIR}/files/launcher/images/openmw.png" DESTINATION "${ICONDIR}" COMPONENT "openmw")
|
||||
|
|
|
@ -13,7 +13,9 @@ OpenMW also comes with OpenMW-CS, a replacement for Bethesda's Construction Set.
|
|||
|
||||
|
||||
Font Licenses:
|
||||
* DejaVuLGCSansMono.ttf: custom (see [files/mygui/DejaVuFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/mygui/DejaVuFontLicense.txt) for more information)
|
||||
* DejaVuLGCSansMono.ttf: custom (see [files/data/fonts/DejaVuFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/DejaVuFontLicense.txt) for more information)
|
||||
* OMWAyembedt.ttf: SIL Open Font License (see [files/data/fonts/OMWAyembedtFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/OMWAyembedtFontLicense.txt) for more information)
|
||||
* Pelagiad.ttf: SIL Open Font License (see [files/data/fonts/PelagiadFontLicense.txt](https://gitlab.com/OpenMW/openmw/-/raw/master/files/data/fonts/PelagiadFontLicense.txt) for more information)
|
||||
|
||||
Current Status
|
||||
--------------
|
||||
|
|
|
@ -453,7 +453,6 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
|||
, mScriptConsoleMode (false)
|
||||
, mActivationDistanceOverride(-1)
|
||||
, mGrab(true)
|
||||
, mExportFonts(false)
|
||||
, mRandomSeed(0)
|
||||
, mFSStrict (false)
|
||||
, mScriptBlacklistUse (true)
|
||||
|
@ -700,7 +699,7 @@ void OMW::Engine::createWindow()
|
|||
void OMW::Engine::setWindowIcon()
|
||||
{
|
||||
std::ifstream windowIconStream;
|
||||
std::string windowIcon = (mResDir / "mygui" / "openmw.png").string();
|
||||
std::string windowIcon = (mResDir / "openmw.png").string();
|
||||
windowIconStream.open(windowIcon, std::ios_base::in | std::ios_base::binary);
|
||||
if (windowIconStream.fail())
|
||||
Log(Debug::Error) << "Error: Failed to open " << windowIcon;
|
||||
|
@ -815,7 +814,6 @@ void OMW::Engine::prepareEngine()
|
|||
exts->glRenderbufferStorageMultisampleCoverageNV = nullptr;
|
||||
#endif
|
||||
|
||||
std::string myguiResources = (mResDir / "mygui").string();
|
||||
osg::ref_ptr<osg::Group> guiRoot = new osg::Group;
|
||||
guiRoot->setName("GUI Root");
|
||||
guiRoot->setNodeMask(MWRender::Mask_GUI);
|
||||
|
@ -823,9 +821,9 @@ void OMW::Engine::prepareEngine()
|
|||
rootNode->addChild(guiRoot);
|
||||
|
||||
mWindowManager = std::make_unique<MWGui::WindowManager>(mWindow, mViewer, guiRoot, mResourceSystem.get(), mWorkQueue.get(),
|
||||
mCfgMgr.getLogPath().string() + std::string("/"), myguiResources,
|
||||
mScriptConsoleMode, mTranslationDataStorage, mEncoding, mExportFonts,
|
||||
Version::getOpenmwVersionDescription(mResDir.string()), mCfgMgr.getUserConfigPath().string(), shadersSupported);
|
||||
mCfgMgr.getLogPath().string() + std::string("/"),
|
||||
mScriptConsoleMode, mTranslationDataStorage, mEncoding,
|
||||
Version::getOpenmwVersionDescription(mResDir.string()), shadersSupported);
|
||||
mEnvironment.setWindowManager(*mWindowManager);
|
||||
|
||||
mInputManager = std::make_unique<MWInput::InputManager>(mWindow, mViewer, mScreenCaptureHandler,
|
||||
|
@ -1037,13 +1035,13 @@ void OMW::Engine::go()
|
|||
}
|
||||
|
||||
// Setup profiler
|
||||
osg::ref_ptr<Resource::Profiler> statshandler = new Resource::Profiler(stats.is_open());
|
||||
osg::ref_ptr<Resource::Profiler> statshandler = new Resource::Profiler(stats.is_open(), mVFS.get());
|
||||
|
||||
initStatsHandler(*statshandler);
|
||||
|
||||
mViewer->addEventHandler(statshandler);
|
||||
|
||||
osg::ref_ptr<Resource::StatsHandler> resourceshandler = new Resource::StatsHandler(stats.is_open());
|
||||
osg::ref_ptr<Resource::StatsHandler> resourceshandler = new Resource::StatsHandler(stats.is_open(), mVFS.get());
|
||||
mViewer->addEventHandler(resourceshandler);
|
||||
|
||||
if (stats.is_open())
|
||||
|
@ -1187,11 +1185,6 @@ void OMW::Engine::setScriptBlacklistUse (bool use)
|
|||
mScriptBlacklistUse = use;
|
||||
}
|
||||
|
||||
void OMW::Engine::enableFontExport(bool exportFonts)
|
||||
{
|
||||
mExportFonts = exportFonts;
|
||||
}
|
||||
|
||||
void OMW::Engine::setSaveGameFile(const std::string &savegame)
|
||||
{
|
||||
mSaveGameFile = savegame;
|
||||
|
|
|
@ -160,7 +160,6 @@ namespace OMW
|
|||
// Grab mouse?
|
||||
bool mGrab;
|
||||
|
||||
bool mExportFonts;
|
||||
unsigned int mRandomSeed;
|
||||
|
||||
Compiler::Extensions mExtensions;
|
||||
|
@ -254,8 +253,6 @@ namespace OMW
|
|||
|
||||
void setScriptBlacklistUse (bool use);
|
||||
|
||||
void enableFontExport(bool exportFonts);
|
||||
|
||||
/// Set the save game file to load after initialising the engine.
|
||||
void setSaveGameFile(const std::string& savegame);
|
||||
|
||||
|
|
|
@ -156,7 +156,6 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
|
|||
Fallback::Map::init(variables["fallback"].as<FallbackMap>().mMap);
|
||||
engine.setSoundUsage(!variables["no-sound"].as<bool>());
|
||||
engine.setActivationDistanceOverride (variables["activate-dist"].as<int>());
|
||||
engine.enableFontExport(variables["export-fonts"].as<bool>());
|
||||
engine.setRandomSeed(variables["random-seed"].as<unsigned int>());
|
||||
|
||||
return true;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <components/vfs/manager.hpp>
|
||||
#include <components/misc/stringops.hpp>
|
||||
#include <components/misc/resourcehelpers.hpp>
|
||||
#include <components/fontloader/fontloader.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
@ -367,7 +368,9 @@ namespace MWGui::Formatting
|
|||
if (attr.find("face") != attr.end())
|
||||
{
|
||||
std::string face = attr.at("face");
|
||||
mTextStyle.mFont = "Journalbook "+face;
|
||||
std::string name = Gui::FontLoader::getFontForFace(face);
|
||||
|
||||
mTextStyle.mFont = "Journalbook "+name;
|
||||
}
|
||||
if (attr.find("size") != attr.end())
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace MWGui
|
|||
{
|
||||
TextStyle() :
|
||||
mColour(0,0,0)
|
||||
, mFont("Journalbook Magic Cards")
|
||||
, mFont("Journalbook DefaultFont")
|
||||
, mTextSize(16)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -128,8 +128,8 @@ namespace MWGui
|
|||
{
|
||||
WindowManager::WindowManager(
|
||||
SDL_Window* window, osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ResourceSystem* resourceSystem, SceneUtil::WorkQueue* workQueue,
|
||||
const std::string& logpath, const std::string& resourcePath, bool consoleOnlyScripts, Translation::Storage& translationDataStorage,
|
||||
ToUTF8::FromType encoding, bool exportFonts, const std::string& versionDescription, const std::string& userDataPath, bool useShaders)
|
||||
const std::string& logpath, bool consoleOnlyScripts, Translation::Storage& translationDataStorage,
|
||||
ToUTF8::FromType encoding, const std::string& versionDescription, bool useShaders)
|
||||
: mOldUpdateMask(0)
|
||||
, mOldCullMask(0)
|
||||
, mStore(nullptr)
|
||||
|
@ -195,7 +195,7 @@ namespace MWGui
|
|||
{
|
||||
mScalingFactor = std::clamp(Settings::Manager::getFloat("scaling factor", "GUI"), 0.5f, 8.f);
|
||||
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), mScalingFactor);
|
||||
mGuiPlatform->initialise(resourcePath, (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
|
||||
mGuiPlatform->initialise(resourceSystem->getVFS(), "mygui", (std::filesystem::path(logpath) / "MyGUI.log").generic_string());
|
||||
|
||||
mGui = new MyGUI::Gui;
|
||||
mGui->initialise("");
|
||||
|
@ -205,8 +205,8 @@ namespace MWGui
|
|||
MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &WindowManager::onRetrieveTag);
|
||||
|
||||
// Load fonts
|
||||
mFontLoader = std::make_unique<Gui::FontLoader>(encoding, resourceSystem->getVFS(), userDataPath, mScalingFactor);
|
||||
mFontLoader->loadBitmapFonts(exportFonts);
|
||||
mFontLoader = std::make_unique<Gui::FontLoader>(encoding, resourceSystem->getVFS(), mScalingFactor);
|
||||
mFontLoader->loadBitmapFonts();
|
||||
|
||||
//Register own widgets with MyGUI
|
||||
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSkill>("Widget");
|
||||
|
@ -234,7 +234,7 @@ namespace MWGui
|
|||
MyGUI::FactoryManager::getInstance().registerFactory<ResourceImageSetPointerFix>("Resource", "ResourceImageSetPointer");
|
||||
MyGUI::FactoryManager::getInstance().registerFactory<AutoSizedResourceSkin>("Resource", "AutoSizedResourceSkin");
|
||||
MyGUI::ResourceManager::getInstance().load("core.xml");
|
||||
WindowManager::loadUserFonts();
|
||||
mFontLoader->loadTrueTypeFonts();
|
||||
|
||||
bool keyboardNav = Settings::Manager::getBool("keyboard navigation", "GUI");
|
||||
mKeyboardNavigation = std::make_unique<KeyboardNavigation>();
|
||||
|
@ -290,11 +290,6 @@ namespace MWGui
|
|||
mStatsWatcher = std::make_unique<StatsWatcher>();
|
||||
}
|
||||
|
||||
void WindowManager::loadUserFonts()
|
||||
{
|
||||
mFontLoader->loadTrueTypeFonts();
|
||||
}
|
||||
|
||||
void WindowManager::initUI()
|
||||
{
|
||||
// Get size info from the Gui object
|
||||
|
@ -1179,7 +1174,7 @@ namespace MWGui
|
|||
window->onResChange(x, y);
|
||||
|
||||
// We should reload TrueType fonts to fit new resolution
|
||||
loadUserFonts();
|
||||
mFontLoader->loadTrueTypeFonts();
|
||||
|
||||
// TODO: check if any windows are now off-screen and move them back if so
|
||||
}
|
||||
|
|
|
@ -135,15 +135,14 @@ namespace MWGui
|
|||
typedef std::vector<Faction> FactionList;
|
||||
|
||||
WindowManager(SDL_Window* window, osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ResourceSystem* resourceSystem, SceneUtil::WorkQueue* workQueue,
|
||||
const std::string& logpath, const std::string& cacheDir, bool consoleOnlyScripts, Translation::Storage& translationDataStorage,
|
||||
ToUTF8::FromType encoding, bool exportFonts, const std::string& versionDescription, const std::string& localPath, bool useShaders);
|
||||
const std::string& logpath, bool consoleOnlyScripts, Translation::Storage& translationDataStorage,
|
||||
ToUTF8::FromType encoding, const std::string& versionDescription, bool useShaders);
|
||||
virtual ~WindowManager();
|
||||
|
||||
/// Set the ESMStore to use for retrieving of GUI-related strings.
|
||||
void setStore (const MWWorld::ESMStore& store);
|
||||
|
||||
void initUI();
|
||||
void loadUserFonts();
|
||||
|
||||
Loading::Listener* getLoadingScreen() override;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "fontloader.hpp"
|
||||
|
||||
#include <filesystem>
|
||||
#include <stdexcept>
|
||||
#include <string_view>
|
||||
#include <array>
|
||||
|
@ -17,6 +16,8 @@
|
|||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
#include <components/fallback/fallback.hpp>
|
||||
|
||||
#include <components/vfs/manager.hpp>
|
||||
|
||||
#include <components/misc/pathhelpers.hpp>
|
||||
|
@ -151,9 +152,8 @@ namespace
|
|||
namespace Gui
|
||||
{
|
||||
|
||||
FontLoader::FontLoader(ToUTF8::FromType encoding, const VFS::Manager* vfs, const std::string& userDataPath, float scalingFactor)
|
||||
FontLoader::FontLoader(ToUTF8::FromType encoding, const VFS::Manager* vfs, float scalingFactor)
|
||||
: mVFS(vfs)
|
||||
, mUserDataPath(userDataPath)
|
||||
, mFontHeight(std::clamp(Settings::Manager::getInt("font size", "GUI"), 12, 20))
|
||||
, mScalingFactor(scalingFactor)
|
||||
{
|
||||
|
@ -196,12 +196,12 @@ namespace Gui
|
|||
mFonts.clear();
|
||||
}
|
||||
|
||||
void FontLoader::loadBitmapFonts(bool exportToFile)
|
||||
void FontLoader::loadBitmapFonts()
|
||||
{
|
||||
for (const auto& name : mVFS->getRecursiveDirectoryIterator("Fonts/"))
|
||||
for (const auto& path : mVFS->getRecursiveDirectoryIterator("Fonts/"))
|
||||
{
|
||||
if (Misc::getFileExtension(name) == "fnt")
|
||||
loadBitmapFont(name, exportToFile);
|
||||
if (Misc::getFileExtension(path) == "fnt")
|
||||
loadBitmapFont(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,17 +214,18 @@ namespace Gui
|
|||
return;
|
||||
}
|
||||
|
||||
const std::string cfg = dataManager->getDataPath("");
|
||||
const std::string fontFile = mUserDataPath + "/" + "Fonts" + "/" + "openmw_font.xml";
|
||||
if (!std::filesystem::exists(fontFile))
|
||||
return;
|
||||
std::string oldDataPath = dataManager->getDataPath("");
|
||||
dataManager->setResourcePath("fonts");
|
||||
|
||||
dataManager->setResourcePath(mUserDataPath + "/" + "Fonts");
|
||||
MyGUI::ResourceManager::getInstance().load("openmw_font.xml");
|
||||
dataManager->setResourcePath(cfg);
|
||||
for (const auto& path : mVFS->getRecursiveDirectoryIterator("Fonts/"))
|
||||
{
|
||||
if (Misc::getFileExtension(path) == "omwfont")
|
||||
MyGUI::ResourceManager::getInstance().load(std::string(Misc::getFileName(path)));
|
||||
}
|
||||
|
||||
dataManager->setResourcePath(oldDataPath);
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x;
|
||||
|
@ -245,7 +246,7 @@ namespace Gui
|
|||
float ascent;
|
||||
} GlyphInfo;
|
||||
|
||||
void FontLoader::loadBitmapFont(const std::string &fileName, bool exportToFile)
|
||||
void FontLoader::loadBitmapFont(const std::string &fileName)
|
||||
{
|
||||
Files::IStreamPtr file = mVFS->get(fileName);
|
||||
|
||||
|
@ -304,24 +305,7 @@ namespace Gui
|
|||
fail(*bitmapFile, bitmapFilename, "File too small to be a valid bitmap");
|
||||
bitmapFile.reset();
|
||||
|
||||
std::string resourceName;
|
||||
if (name.size() >= 5 && Misc::StringUtils::ciEqual(name.substr(0, 5), "magic"))
|
||||
resourceName = "Magic Cards";
|
||||
else if (name.size() >= 7 && Misc::StringUtils::ciEqual(name.substr(0, 7), "century"))
|
||||
resourceName = "Century Gothic";
|
||||
else if (name.size() >= 7 && Misc::StringUtils::ciEqual(name.substr(0, 7), "daedric"))
|
||||
resourceName = "Daedric";
|
||||
|
||||
if (exportToFile)
|
||||
{
|
||||
osg::ref_ptr<osg::Image> image = new osg::Image;
|
||||
image->allocateImage(width, height, 1, GL_RGBA, GL_UNSIGNED_BYTE);
|
||||
assert (image->isDataContiguous());
|
||||
memcpy(image->data(), &textureData[0], textureData.size());
|
||||
|
||||
Log(Debug::Info) << "Writing " << resourceName + ".png";
|
||||
osgDB::writeImageFile(*image, resourceName + ".png");
|
||||
}
|
||||
std::string resourceName = name;
|
||||
|
||||
// Register the font with MyGUI
|
||||
MyGUI::ResourceManualFont* font = static_cast<MyGUI::ResourceManualFont*>(
|
||||
|
@ -346,7 +330,9 @@ namespace Gui
|
|||
// We need to emulate loading from XML because the data members are private as of mygui 3.2.0
|
||||
MyGUI::xml::Document xmlDocument;
|
||||
MyGUI::xml::ElementPtr root = xmlDocument.createRoot("ResourceManualFont");
|
||||
root->addAttribute("name", resourceName);
|
||||
|
||||
std::string baseName(Misc::stemFile(fileName));
|
||||
root->addAttribute("name", getInternalFontName(baseName));
|
||||
|
||||
MyGUI::xml::ElementPtr defaultHeight = root->createChild("Property");
|
||||
defaultHeight->addAttribute("key", "DefaultHeight");
|
||||
|
@ -497,21 +483,13 @@ namespace Gui
|
|||
cursorCode->addAttribute("size", "0 0");
|
||||
}
|
||||
|
||||
if (exportToFile)
|
||||
{
|
||||
Log(Debug::Info) << "Writing " << resourceName + ".xml";
|
||||
xmlDocument.createDeclaration();
|
||||
xmlDocument.save(resourceName + ".xml");
|
||||
}
|
||||
|
||||
font->deserialization(root, MyGUI::Version(3,2,0));
|
||||
|
||||
// Setup "book" version of font as fallback if we will not use TrueType fonts
|
||||
MyGUI::ResourceManualFont* bookFont = static_cast<MyGUI::ResourceManualFont*>(
|
||||
MyGUI::FactoryManager::getInstance().createObject("Resource", "ResourceManualFont"));
|
||||
mFonts.push_back(bookFont);
|
||||
bookFont->deserialization(root, MyGUI::Version(3,2,0));
|
||||
bookFont->setResourceName("Journalbook " + resourceName);
|
||||
bookFont->setResourceName("Journalbook " + getInternalFontName(baseName));
|
||||
|
||||
// Remove automatically registered fonts
|
||||
for (std::vector<MyGUI::ResourceManualFont*>::iterator it = mFonts.begin(); it != mFonts.end();)
|
||||
|
@ -564,6 +542,8 @@ namespace Gui
|
|||
MyGUI::xml::ElementPtr sizeNode = resourceNode->createChild("Property");
|
||||
sizeNode->addAttribute("key", "Size");
|
||||
sizeNode->addAttribute("value", std::to_string(mFontHeight));
|
||||
|
||||
resourceNode->setAttribute("name", getInternalFontName(name));
|
||||
}
|
||||
else if (Misc::StringUtils::ciEqual(type, "ResourceSkin") ||
|
||||
Misc::StringUtils::ciEqual(type, "AutoSizedResourceSkin"))
|
||||
|
@ -611,7 +591,7 @@ namespace Gui
|
|||
resolutionNode->addAttribute("key", "Resolution");
|
||||
resolutionNode->addAttribute("value", std::to_string(resolution));
|
||||
|
||||
copyFont->setAttribute("name", "Journalbook " + name);
|
||||
copyFont->setAttribute("name", "Journalbook " + getInternalFontName(name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -623,4 +603,36 @@ namespace Gui
|
|||
{
|
||||
return mFontHeight;
|
||||
}
|
||||
|
||||
std::string FontLoader::getInternalFontName(const std::string& name)
|
||||
{
|
||||
const std::string lowerName = Misc::StringUtils::lowerCase(name);
|
||||
|
||||
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_0")))
|
||||
return "DefaultFont";
|
||||
if (lowerName == Misc::StringUtils::lowerCase(Fallback::Map::getString("Fonts_Font_2")))
|
||||
return "ScrollFont";
|
||||
if (lowerName == "dejavusansmono")
|
||||
return "MonoFont"; // We need to use a TrueType monospace font to display debug texts properly.
|
||||
|
||||
// Use our TrueType fonts as a fallback.
|
||||
if (!MyGUI::ResourceManager::getInstance().isExist("DefaultFont") && name == "pelagiad")
|
||||
return "DefaultFont";
|
||||
if (!MyGUI::ResourceManager::getInstance().isExist("ScrollFont") && name == "ayembedt")
|
||||
return "ScrollFont";
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string FontLoader::getFontForFace(const std::string& face)
|
||||
{
|
||||
const std::string lowerFace = Misc::StringUtils::lowerCase(face);
|
||||
|
||||
if (lowerFace == "magic cards")
|
||||
return "DefaultFont";
|
||||
if (lowerFace == "daedric")
|
||||
return "ScrollFont";
|
||||
|
||||
return face;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,29 +25,30 @@ namespace Gui
|
|||
class FontLoader
|
||||
{
|
||||
public:
|
||||
FontLoader (ToUTF8::FromType encoding, const VFS::Manager* vfs, const std::string& userDataPath, float scalingFactor);
|
||||
FontLoader (ToUTF8::FromType encoding, const VFS::Manager* vfs, float scalingFactor);
|
||||
~FontLoader();
|
||||
|
||||
/// @param exportToFile export the converted fonts (Images and XML with glyph metrics) to files?
|
||||
void loadBitmapFonts (bool exportToFile);
|
||||
void loadBitmapFonts ();
|
||||
void loadTrueTypeFonts ();
|
||||
|
||||
void loadFontFromXml(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version);
|
||||
|
||||
int getFontHeight();
|
||||
|
||||
static std::string getFontForFace(const std::string& face);
|
||||
|
||||
private:
|
||||
ToUTF8::FromType mEncoding;
|
||||
const VFS::Manager* mVFS;
|
||||
std::string mUserDataPath;
|
||||
int mFontHeight;
|
||||
float mScalingFactor;
|
||||
|
||||
std::vector<MyGUI::ITexture*> mTextures;
|
||||
std::vector<MyGUI::ResourceManualFont*> mFonts;
|
||||
|
||||
/// @param exportToFile export the converted font (Image and XML with glyph metrics) to files?
|
||||
void loadBitmapFont (const std::string& fileName, bool exportToFile);
|
||||
std::string getInternalFontName(const std::string& name);
|
||||
|
||||
void loadBitmapFont (const std::string& fileName);
|
||||
|
||||
FontLoader(const FontLoader&);
|
||||
void operator=(const FontLoader&);
|
||||
|
|
|
@ -14,6 +14,28 @@ namespace Misc
|
|||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
inline std::string_view getFileName(std::string_view path)
|
||||
{
|
||||
if (auto namePos = path.find_last_of("/\\"); namePos != std::string::npos)
|
||||
{
|
||||
path.remove_prefix(namePos + 1);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
inline std::string_view stemFile(std::string_view path)
|
||||
{
|
||||
path = getFileName(path);
|
||||
|
||||
if (auto extPos = path.find_last_of("."); extPos != std::string::npos)
|
||||
{
|
||||
path.remove_suffix(path.size() - extPos);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,15 +20,13 @@ void DataManager::setResourcePath(const std::string &path)
|
|||
|
||||
MyGUI::IDataStream *DataManager::getData(const std::string &name) const
|
||||
{
|
||||
std::string fullpath = getDataPath(name);
|
||||
auto stream = std::make_unique<std::ifstream>();
|
||||
stream->open(fullpath, std::ios::binary);
|
||||
if (stream->fail())
|
||||
{
|
||||
Log(Debug::Error) << "DataManager::getData: Failed to open '" << name << "'";
|
||||
return nullptr;
|
||||
}
|
||||
return new MyGUI::DataFileStream(stream.release());
|
||||
// Note: MyGUI is supposed to read/free input steam itself,
|
||||
// so copy data from VFS stream to the string stream and pass it to MyGUI.
|
||||
Files::IStreamPtr streamPtr = mVfs->get(mResourcePath + "/" + name);
|
||||
std::istream* fileStream = streamPtr.get();
|
||||
auto dataStream = std::make_unique<std::stringstream>();
|
||||
*dataStream << fileStream->rdbuf();
|
||||
return new MyGUI::DataStream(dataStream.release());
|
||||
}
|
||||
|
||||
void DataManager::freeData(MyGUI::IDataStream *data)
|
||||
|
@ -38,27 +36,30 @@ void DataManager::freeData(MyGUI::IDataStream *data)
|
|||
|
||||
bool DataManager::isDataExist(const std::string &name) const
|
||||
{
|
||||
std::string fullpath = mResourcePath + "/" + name;
|
||||
return std::filesystem::exists(fullpath);
|
||||
return mVfs->exists(mResourcePath + "/" + name);
|
||||
}
|
||||
|
||||
void DataManager::setVfs(const VFS::Manager* vfs)
|
||||
{
|
||||
mVfs = vfs;
|
||||
}
|
||||
|
||||
const MyGUI::VectorString &DataManager::getDataListNames(const std::string &pattern) const
|
||||
{
|
||||
// TODO: pattern matching (unused?)
|
||||
static MyGUI::VectorString strings;
|
||||
strings.clear();
|
||||
strings.push_back(getDataPath(pattern));
|
||||
return strings;
|
||||
throw std::runtime_error("DataManager::getDataListNames is not implemented - VFS is used");
|
||||
}
|
||||
|
||||
const std::string &DataManager::getDataPath(const std::string &name) const
|
||||
{
|
||||
static std::string result;
|
||||
result.clear();
|
||||
|
||||
if (name.empty())
|
||||
return mResourcePath;
|
||||
|
||||
if (!isDataExist(name))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
result = mResourcePath + "/" + name;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <components/vfs/manager.hpp>
|
||||
|
||||
namespace osgMyGUI
|
||||
{
|
||||
|
||||
|
@ -16,6 +18,8 @@ public:
|
|||
|
||||
void setResourcePath(const std::string& path);
|
||||
|
||||
void setVfs(const VFS::Manager* vfs);
|
||||
|
||||
/** Get data stream from specified resource name.
|
||||
@param _name Resource name (usually file name).
|
||||
*/
|
||||
|
@ -44,6 +48,8 @@ public:
|
|||
|
||||
private:
|
||||
std::string mResourcePath;
|
||||
|
||||
const VFS::Manager* mVfs;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ Platform::~Platform()
|
|||
mLogFacility = nullptr;
|
||||
}
|
||||
|
||||
void Platform::initialise(const std::string &resourcePath, const std::string &_logName)
|
||||
void Platform::initialise(const VFS::Manager* vfs, const std::string &resourcePath, const std::string &_logName)
|
||||
{
|
||||
if (!_logName.empty() && !mLogFacility)
|
||||
{
|
||||
|
@ -39,6 +39,7 @@ void Platform::initialise(const std::string &resourcePath, const std::string &_l
|
|||
}
|
||||
|
||||
mDataManager->setResourcePath(resourcePath);
|
||||
mDataManager->setVfs(vfs);
|
||||
|
||||
mRenderManager->initialise();
|
||||
mDataManager->initialise();
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include <components/vfs/manager.hpp>
|
||||
|
||||
namespace osgViewer
|
||||
{
|
||||
class Viewer;
|
||||
|
@ -34,7 +36,7 @@ namespace osgMyGUI
|
|||
|
||||
~Platform();
|
||||
|
||||
void initialise(const std::string& resourcePath, const std::string& _logName = "MyGUI.log");
|
||||
void initialise(const VFS::Manager* vfs, const std::string& resourcePath, const std::string& _logName = "MyGUI.log");
|
||||
|
||||
void shutdown();
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <osg/PolygonMode>
|
||||
|
||||
#include <osgText/Font>
|
||||
#include <osgText/Text>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
|
@ -15,6 +16,8 @@
|
|||
|
||||
#include <components/myguiplatform/myguidatamanager.hpp>
|
||||
|
||||
#include <components/vfs/manager.hpp>
|
||||
|
||||
namespace Resource
|
||||
{
|
||||
|
||||
|
@ -28,6 +31,8 @@ static bool collectStatFrameRate = false;
|
|||
static bool collectStatUpdate = false;
|
||||
static bool collectStatEngine = false;
|
||||
|
||||
constexpr std::string_view sFontName = "Fonts/DejaVuLGCSansMono.ttf";
|
||||
|
||||
static void setupStatCollection()
|
||||
{
|
||||
const char* envList = getenv("OPENMW_OSG_STATS_LIST");
|
||||
|
@ -79,14 +84,44 @@ static void setupStatCollection()
|
|||
}
|
||||
}
|
||||
|
||||
StatsHandler::StatsHandler(bool offlineCollect):
|
||||
class SetFontVisitor : public osg::NodeVisitor
|
||||
{
|
||||
public:
|
||||
SetFontVisitor(osgText::Font* font)
|
||||
: osg::NodeVisitor(TRAVERSE_ALL_CHILDREN)
|
||||
, mFont(font)
|
||||
{}
|
||||
|
||||
void apply(osg::Drawable& node) override
|
||||
{
|
||||
if (osgText::Text* text = dynamic_cast<osgText::Text*>(&node))
|
||||
{
|
||||
text->setFont(mFont);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
osgText::Font* mFont;
|
||||
};
|
||||
|
||||
osg::ref_ptr<osgText::Font> getMonoFont(VFS::Manager* vfs)
|
||||
{
|
||||
if (osgDB::Registry::instance()->getReaderWriterForExtension("ttf") && vfs->exists(sFontName))
|
||||
{
|
||||
Files::IStreamPtr streamPtr = vfs->get(sFontName);
|
||||
return osgText::readRefFontStream(*streamPtr.get());
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StatsHandler::StatsHandler(bool offlineCollect, VFS::Manager* vfs):
|
||||
_key(osgGA::GUIEventAdapter::KEY_F4),
|
||||
_initialized(false),
|
||||
_statsType(false),
|
||||
_offlineCollect(offlineCollect),
|
||||
_statsWidth(1280.0f),
|
||||
_statsHeight(1024.0f),
|
||||
_font(""),
|
||||
_characterSize(18.0f)
|
||||
{
|
||||
_camera = new osg::Camera;
|
||||
|
@ -96,29 +131,40 @@ StatsHandler::StatsHandler(bool offlineCollect):
|
|||
|
||||
_resourceStatsChildNum = 0;
|
||||
|
||||
if (osgDB::Registry::instance()->getReaderWriterForExtension("ttf"))
|
||||
_font = osgMyGUI::DataManager::getInstance().getDataPath("DejaVuLGCSansMono.ttf");
|
||||
_textFont = getMonoFont(vfs);
|
||||
}
|
||||
|
||||
Profiler::Profiler(bool offlineCollect):
|
||||
_offlineCollect(offlineCollect)
|
||||
Profiler::Profiler(bool offlineCollect, VFS::Manager* vfs):
|
||||
_offlineCollect(offlineCollect),
|
||||
_initFonts(false)
|
||||
{
|
||||
if (osgDB::Registry::instance()->getReaderWriterForExtension("ttf"))
|
||||
_font = osgMyGUI::DataManager::getInstance().getDataPath("DejaVuLGCSansMono.ttf");
|
||||
else
|
||||
_font.clear();
|
||||
|
||||
_characterSize = 18;
|
||||
_font.clear();
|
||||
|
||||
_textFont = getMonoFont(vfs);
|
||||
|
||||
setKeyEventTogglesOnScreenStats(osgGA::GUIEventAdapter::KEY_F3);
|
||||
setupStatCollection();
|
||||
}
|
||||
|
||||
void Profiler::setUpFonts()
|
||||
{
|
||||
if (_textFont != nullptr)
|
||||
{
|
||||
SetFontVisitor visitor(_textFont);
|
||||
_switch->accept(visitor);
|
||||
}
|
||||
|
||||
_initFonts = true;
|
||||
}
|
||||
|
||||
bool Profiler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
|
||||
{
|
||||
osgViewer::ViewerBase* viewer = nullptr;
|
||||
|
||||
bool handled = StatsHandler::handle(ea, aa);
|
||||
if (_initialized && !_initFonts)
|
||||
setUpFonts();
|
||||
|
||||
auto* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||
if (view)
|
||||
|
@ -423,7 +469,6 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase *viewer)
|
|||
osg::ref_ptr<osgText::Text> staticText = new osgText::Text;
|
||||
group->addChild( staticText.get() );
|
||||
staticText->setColor(staticTextColor);
|
||||
staticText->setFont(_font);
|
||||
staticText->setCharacterSize(_characterSize);
|
||||
staticText->setPosition(pos);
|
||||
|
||||
|
@ -449,11 +494,16 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase *viewer)
|
|||
group->addChild( statsText.get() );
|
||||
|
||||
statsText->setColor(dynamicTextColor);
|
||||
statsText->setFont(_font);
|
||||
statsText->setCharacterSize(_characterSize);
|
||||
statsText->setPosition(pos);
|
||||
statsText->setText("");
|
||||
statsText->setDrawCallback(new ResourceStatsTextDrawCallback(viewer->getViewerStats(), statNames));
|
||||
|
||||
if (_textFont)
|
||||
{
|
||||
staticText->setFont(_textFont);
|
||||
statsText->setFont(_textFont);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,22 +13,36 @@ namespace osg
|
|||
class Switch;
|
||||
}
|
||||
|
||||
namespace osgText
|
||||
{
|
||||
class Font;
|
||||
}
|
||||
|
||||
namespace VFS
|
||||
{
|
||||
class Manager;
|
||||
}
|
||||
|
||||
namespace Resource
|
||||
{
|
||||
class Profiler : public osgViewer::StatsHandler
|
||||
{
|
||||
public:
|
||||
Profiler(bool offlineCollect);
|
||||
Profiler(bool offlineCollect, VFS::Manager* vfs);
|
||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) override;
|
||||
|
||||
private:
|
||||
void setUpFonts();
|
||||
|
||||
bool _offlineCollect;
|
||||
bool _initFonts;
|
||||
osg::ref_ptr<osgText::Font> _textFont;
|
||||
};
|
||||
|
||||
class StatsHandler : public osgGA::GUIEventHandler
|
||||
{
|
||||
public:
|
||||
StatsHandler(bool offlineCollect);
|
||||
StatsHandler(bool offlineCollect, VFS::Manager* vfs);
|
||||
|
||||
void setKey(int key) { _key = key; }
|
||||
int getKey() const { return _key; }
|
||||
|
@ -56,11 +70,11 @@ namespace Resource
|
|||
float _statsWidth;
|
||||
float _statsHeight;
|
||||
|
||||
std::string _font;
|
||||
float _characterSize;
|
||||
|
||||
int _resourceStatsChildNum;
|
||||
|
||||
osg::ref_ptr<osgText::Font> _textFont;
|
||||
};
|
||||
|
||||
void CollectStatistics(osgViewer::ViewerBase* viewer);
|
||||
|
|
|
@ -1,30 +1,44 @@
|
|||
Fonts
|
||||
#####
|
||||
|
||||
Default UI font and font used in magic scrolls are defined in ``openmw.cfg``:
|
||||
|
||||
fallback=Fonts_Font_0,pelagiad
|
||||
fallback=Fonts_Font_2,ayembedt
|
||||
|
||||
By default, built-in TrueType fonts are used. Font used by console and another debug windows is not configurable (so ``Fonts_Font_1`` is unused).
|
||||
|
||||
Morrowind .fnt fonts
|
||||
--------------------
|
||||
|
||||
Morrowind uses a custom ``.fnt`` file format. It is not compatible with the Windows Font File ``.fnt`` format.
|
||||
To our knowledge, the format is undocumented.
|
||||
To our knowledge, the format is undocumented. OpenMW can load this format and convert it on the fly into something usable
|
||||
(see font loader `source code <https://gitlab.com/OpenMW/openmw/blob/master/components/fontloader/fontloader.cpp>`_).
|
||||
|
||||
OpenMW can load this format and convert it on the fly into something usable
|
||||
(see font loader `source code <https://github.com/OpenMW/openmw/blob/master/components/fontloader/fontloader.cpp#L210>`_).
|
||||
You can use --export-fonts command line option to write the converted font
|
||||
(a PNG image and an XML file describing the position of each glyph in the image) to the current directory.
|
||||
They can be used instead of TrueType fonts if needed by specifying their ``.fnt`` files names in the ``openmw.cfg``. For example:
|
||||
|
||||
fallback=Fonts_Font_0,magic_cards_regular
|
||||
fallback=Fonts_Font_2,daedric_font
|
||||
|
||||
In this example OpenMW will search for ``magic_cards_regular.fnt`` and ``daedric_font.fnt`` in the ``Fonts`` folder in data directories.
|
||||
If they are not found, built-in TrueType fonts will be used as a fallback.
|
||||
Note that an import wizard copies values from ``Morrowind.ini``, so bitmap fonts will be used after import.
|
||||
If such behaviour is undesirable, ``Fonts_Font*`` entries should be removed from ``openmw.cfg``.
|
||||
|
||||
TrueType fonts
|
||||
--------------
|
||||
|
||||
Unlike vanilla Morrowind, OpenMW directly supports TrueType (``.ttf``) fonts.
|
||||
Unlike vanilla Morrowind, OpenMW directly supports TrueType (``.ttf``) fonts. This is the recommended fonts format.
|
||||
OpenMW has build-in TrueType fonts: Pelagiad, OMWAyembedt and DejaVuLGCSansMono, which are used by default.
|
||||
TrueType fonts are configured via ``openmw.cfg`` too:
|
||||
|
||||
This is the recommended way to install replacement fonts.
|
||||
fallback=Fonts_Font_0,pelagiad
|
||||
fallback=Fonts_Font_2,ayembedt
|
||||
|
||||
1. Download `TrueType fonts for OpenMW <https://www.nexusmods.com/morrowind/mods/46854>`_
|
||||
2. Place the ``Fonts`` folder from archive to the configuration folder. Use :doc:`paths` article to find the folder.
|
||||
In this example, OpenMW will scan ``Fonts`` folder in data directories for ``.omwfont`` files.
|
||||
These files are XML files wich schema used by MyGUI. OpenMW uses files which ``name`` tag matches ``openmw.cfg`` entries:
|
||||
|
||||
Now Fonts folder should include ``openmw_font.xml`` file and three ``.ttf`` files.
|
||||
|
||||
If desired, you can now delete the ``Data Files/Fonts`` directory.
|
||||
<Resource type="ResourceTrueTypeFont" name="pelagiad">
|
||||
|
||||
It is also possible to adjust the font size and resolution via ``settings.cfg`` file::
|
||||
|
||||
|
@ -34,14 +48,6 @@ It is also possible to adjust the font size and resolution via ``settings.cfg``
|
|||
|
||||
The ``font size`` setting accepts clamped values in range from 12 to 20 while ``ttf resolution`` setting accepts values from 48 to 960.
|
||||
|
||||
Any Resolution or Size properties in the XML file have no effect because the engine settings override them.
|
||||
Any Resolution or Size properties in the ``.omwfont`` file have no effect because the engine settings override them.
|
||||
|
||||
The engine automatically takes UI scaling factor into account, so don't account for it when tweaking the settings.
|
||||
|
||||
Bitmap fonts
|
||||
------------
|
||||
|
||||
Morrowind ``.fnt`` files are essentially a bitmap font, but using them is discouraged because they don't have Unicode support.
|
||||
MyGUI has its own format for bitmap fonts. An example can be seen by using the --export-fonts command line option (see above),
|
||||
which converts Morrowind ``.fnt`` to a MyGUI bitmap font.
|
||||
This is the recommended format to use if you wish to edit Morrowind's bitmap font or create a new bitmap font.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
add_subdirectory(mygui)
|
||||
add_subdirectory(shaders)
|
||||
add_subdirectory(data)
|
||||
add_subdirectory(lua_api)
|
||||
|
||||
copy_resource_file("launcher/images/openmw.png" "${OPENMW_RESOURCES_ROOT}" "resources/openmw.png")
|
||||
|
|
|
@ -10,6 +10,16 @@ set(BUILTIN_DATA_FILES
|
|||
textures/omw_menu_scroll_center_h.dds
|
||||
textures/omw_menu_scroll_center_v.dds
|
||||
|
||||
fonts/DejaVuFontLicense.txt
|
||||
fonts/DejaVuLGCSansMono.ttf
|
||||
fonts/DejaVuLGCSansMono.omwfont
|
||||
fonts/OMWAyembedt.ttf
|
||||
fonts/OMWAyembedt.omwfont
|
||||
fonts/OMWAyembedtFontLicense.txt
|
||||
fonts/Pelagiad.ttf
|
||||
fonts/Pelagiad.omwfont
|
||||
fonts/PelagiadFontLicense.txt
|
||||
|
||||
l10n/Calendar/en.yaml
|
||||
l10n/Calendar/ru.yaml
|
||||
l10n/DebugMenu/en.yaml
|
||||
|
@ -59,6 +69,94 @@ set(BUILTIN_DATA_FILES
|
|||
|
||||
shaders/main.omwfx
|
||||
shaders/displaydepth.omwfx
|
||||
|
||||
mygui/core.skin
|
||||
mygui/core.xml
|
||||
mygui/core_layouteditor.xml
|
||||
mygui/openmw_alchemy_window.layout
|
||||
mygui/openmw_book.layout
|
||||
mygui/openmw_box.skin.xml
|
||||
mygui/openmw_button.skin.xml
|
||||
mygui/openmw_chargen_birth.layout
|
||||
mygui/openmw_chargen_class_description.layout
|
||||
mygui/openmw_chargen_class.layout
|
||||
mygui/openmw_chargen_create_class.layout
|
||||
mygui/openmw_chargen_generate_class_result.layout
|
||||
mygui/openmw_chargen_race.layout
|
||||
mygui/openmw_chargen_review.layout
|
||||
mygui/openmw_chargen_select_attribute.layout
|
||||
mygui/openmw_chargen_select_skill.layout
|
||||
mygui/openmw_chargen_select_specialization.layout
|
||||
mygui/openmw_confirmation_dialog.layout
|
||||
mygui/openmw_console.layout
|
||||
mygui/openmw_console.skin.xml
|
||||
mygui/openmw_container_window.layout
|
||||
mygui/openmw_count_window.layout
|
||||
mygui/openmw_dialogue_window.layout
|
||||
mygui/openmw_dialogue_window.skin.xml
|
||||
mygui/openmw_edit.skin.xml
|
||||
mygui/openmw_hud_box.skin.xml
|
||||
mygui/openmw_hud_energybar.skin.xml
|
||||
mygui/openmw_hud.layout
|
||||
mygui/openmw_infobox.layout
|
||||
mygui/openmw_interactive_messagebox.layout
|
||||
mygui/openmw_interactive_messagebox_notransp.layout
|
||||
mygui/openmw_inventory_window.layout
|
||||
mygui/openmw_journal.layout
|
||||
mygui/openmw_journal.skin.xml
|
||||
mygui/openmw_layers.xml
|
||||
mygui/openmw_lua.xml
|
||||
mygui/openmw_list.skin.xml
|
||||
mygui/openmw_mainmenu.layout
|
||||
mygui/openmw_mainmenu.skin.xml
|
||||
mygui/openmw_map_window.layout
|
||||
mygui/openmw_map_window.skin.xml
|
||||
mygui/openmw_messagebox.layout
|
||||
mygui/openmw_pointer.xml
|
||||
mygui/openmw_progress.skin.xml
|
||||
mygui/openmw_resources.xml
|
||||
mygui/openmw_scroll.layout
|
||||
mygui/openmw_scroll.skin.xml
|
||||
mygui/openmw_settings_window.layout
|
||||
mygui/openmw_settings.xml
|
||||
mygui/openmw_spell_window.layout
|
||||
mygui/openmw_stats_window.layout
|
||||
mygui/openmw_text_input.layout
|
||||
mygui/openmw_text.skin.xml
|
||||
mygui/openmw_tooltips.layout
|
||||
mygui/openmw_trade_window.layout
|
||||
mygui/openmw_spell_buying_window.layout
|
||||
mygui/openmw_windows.skin.xml
|
||||
mygui/openmw_quickkeys_menu.layout
|
||||
mygui/openmw_quickkeys_menu_assign.layout
|
||||
mygui/openmw_itemselection_dialog.layout
|
||||
mygui/openmw_magicselection_dialog.layout
|
||||
mygui/openmw_spell_buying_window.layout
|
||||
mygui/openmw_loading_screen.layout
|
||||
mygui/openmw_levelup_dialog.layout
|
||||
mygui/openmw_wait_dialog.layout
|
||||
mygui/openmw_wait_dialog_progressbar.layout
|
||||
mygui/openmw_spellcreation_dialog.layout
|
||||
mygui/openmw_edit_effect.layout
|
||||
mygui/openmw_enchanting_dialog.layout
|
||||
mygui/openmw_trainingwindow.layout
|
||||
mygui/openmw_travel_window.layout
|
||||
mygui/openmw_persuasion_dialog.layout
|
||||
mygui/openmw_merchantrepair.layout
|
||||
mygui/openmw_repair.layout
|
||||
mygui/openmw_companion_window.layout
|
||||
mygui/openmw_savegame_dialog.layout
|
||||
mygui/openmw_recharge_dialog.layout
|
||||
mygui/openmw_screen_fader.layout
|
||||
mygui/openmw_screen_fader_hit.layout
|
||||
mygui/openmw_edit_note.layout
|
||||
mygui/openmw_debug_window.layout
|
||||
mygui/openmw_debug_window.skin.xml
|
||||
mygui/openmw_postprocessor_hud.layout
|
||||
mygui/openmw_postprocessor_hud.skin.xml
|
||||
mygui/openmw_jail_screen.layout
|
||||
mygui/OpenMWResourcePlugin.xml
|
||||
mygui/skins.xml
|
||||
)
|
||||
|
||||
foreach (f ${BUILTIN_DATA_FILES})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Resource" version="1.1">
|
||||
<Resource type="ResourceTrueTypeFont" name="MonoFont">
|
||||
<Resource type="ResourceTrueTypeFont" name="dejavusansmono">
|
||||
<Property key="Source" value="DejaVuLGCSansMono.ttf"/>
|
||||
<Property key="Antialias" value="false"/>
|
||||
<Property key="TabWidth" value="8"/>
|
12
files/data/fonts/OMWAyembedt.omwfont
Normal file
12
files/data/fonts/OMWAyembedt.omwfont
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Resource" version="1.1">
|
||||
<Resource type="ResourceTrueTypeFont" name="ayembedt">
|
||||
<Property key="Source" value="OMWAyembedt.ttf"/>
|
||||
<Property key="Antialias" value="false"/>
|
||||
<Property key="TabWidth" value="8"/>
|
||||
<Property key="OffsetHeight" value="0"/>
|
||||
<Codes>
|
||||
<Code range="32 126"/>
|
||||
</Codes>
|
||||
</Resource>
|
||||
</MyGUI>
|
BIN
files/data/fonts/OMWAyembedt.ttf
Normal file
BIN
files/data/fonts/OMWAyembedt.ttf
Normal file
Binary file not shown.
94
files/data/fonts/OMWAyembedtFontLicense.txt
Normal file
94
files/data/fonts/OMWAyembedtFontLicense.txt
Normal file
|
@ -0,0 +1,94 @@
|
|||
Copyright (c) 2014, Georg Duffner (https://github.com/georgd/OpenMW-Fonts),
|
||||
with Reserved Font Name "OMWAyembedt.ttf".
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
43
files/data/fonts/Pelagiad.omwfont
Normal file
43
files/data/fonts/Pelagiad.omwfont
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MyGUI type="Resource" version="1.1">
|
||||
<Resource type="ResourceTrueTypeFont" name="pelagiad">
|
||||
<Property key="Source" value="Pelagiad.ttf"/>
|
||||
<Property key="Antialias" value="false"/>
|
||||
<Property key="TabWidth" value="8"/>
|
||||
<Property key="OffsetHeight" value="0"/>
|
||||
<Codes>
|
||||
<Code range="33 126"/>
|
||||
<Code range="161"/>
|
||||
<Code range="173"/>
|
||||
<Code range="180"/>
|
||||
<Code range="191 255"/>
|
||||
<Code range="260 263"/>
|
||||
<Code range="268 271"/>
|
||||
<Code range="280 283"/>
|
||||
<Code range="305"/>
|
||||
<Code range="321 324"/>
|
||||
<Code range="327 328"/>
|
||||
<Code range="339"/>
|
||||
<Code range="344 347"/>
|
||||
<Code range="352 353"/>
|
||||
<Code range="356 357"/>
|
||||
<Code range="366 367"/>
|
||||
<Code range="377 382"/>
|
||||
<Code range="1025"/>
|
||||
<Code range="1040 1103"/>
|
||||
<Code range="1105"/>
|
||||
<Code range="8208 8212"/>
|
||||
<Code range="8216 8217"/>
|
||||
<Code range="8220 8221"/>
|
||||
<Code range="8228 8230"/>
|
||||
<Code hide="198"/>
|
||||
<Code hide="208"/>
|
||||
<Code hide="215 216"/>
|
||||
<Code hide="222"/>
|
||||
<Code hide="230"/>
|
||||
<Code hide="240"/>
|
||||
<Code hide="247 248"/>
|
||||
<Code hide="254"/>
|
||||
</Codes>
|
||||
</Resource>
|
||||
</MyGUI>
|
BIN
files/data/fonts/Pelagiad.ttf
Normal file
BIN
files/data/fonts/Pelagiad.ttf
Normal file
Binary file not shown.
94
files/data/fonts/PelagiadFontLicense.txt
Normal file
94
files/data/fonts/PelagiadFontLicense.txt
Normal file
|
@ -0,0 +1,94 @@
|
|||
Copyright (c) 2015, Isak Larborn (isaskar.github.io/Pelagiad|Isaskar@users.noreply.github.com),
|
||||
with Reserved Font Name "Pelagiad.ttf".
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@ -32,13 +32,13 @@
|
|||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="30 358 250 16" name="LeftPageNumber">
|
||||
<Property key="FontName" value="Journalbook Magic Cards"/>
|
||||
<Property key="FontName" value="Journalbook DefaultFont"/>
|
||||
<Property key="TextColour" value="0 0 0"/>
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="NeedMouse" value="false"/>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="NormalText" position="310 358 250 16" name="RightPageNumber">
|
||||
<Property key="FontName" value="Journalbook Magic Cards"/>
|
||||
<Property key="FontName" value="Journalbook DefaultFont"/>
|
||||
<Property key="TextColour" value="0 0 0"/>
|
||||
<Property key="TextAlign" value="Center"/>
|
||||
<Property key="NeedMouse" value="false"/>
|
|
@ -25,12 +25,12 @@
|
|||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="150 350 32 16" name="PageOneNum">
|
||||
<Property key="FontName" value="Journalbook Magic Cards"/>
|
||||
<Property key="FontName" value="Journalbook DefaultFont"/>
|
||||
<Property key="TextColour" value="0 0 0"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="TextBox" skin="NormalText" position="410 350 32 16" name="PageTwoNum">
|
||||
<Property key="FontName" value="Journalbook Magic Cards"/>
|
||||
<Property key="FontName" value="Journalbook DefaultFont"/>
|
||||
<Property key="TextColour" value="0 0 0"/>
|
||||
</Widget>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<MyGUI type="Resource" version="1.1">
|
||||
<Resource type="ResourceSkin" name="MW_BookClient" size="10 10">
|
||||
<Property key="FontName" value="Journalbook Magic Cards"/>
|
||||
<Property key="FontName" value="Journalbook DefaultFont"/>
|
||||
<Property key="TextAlign" value="Left Top"/>
|
||||
<Property key="TextColour" value="0 0 0"/>
|
||||
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
|
||||
|
@ -19,7 +19,7 @@
|
|||
</Resource>
|
||||
|
||||
<Resource type="ResourceSkin" name="MW_QuestLink" size="5 5">
|
||||
<Property key="FontName" value="Journalbook Magic Cards"/>
|
||||
<Property key="FontName" value="Journalbook DefaultFont"/>
|
||||
<Property key="TextAlign" value="Left VCenter"/>
|
||||
|
||||
<BasisSkin type="SimpleText" offset="2 0 1 5" align="Stretch">
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue