summaryrefslogtreecommitdiff
path: root/indra/llrender/llfontregistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llfontregistry.h')
-rw-r--r--indra/llrender/llfontregistry.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h
index 8bbf5aa30c..fcbb2667e4 100644
--- a/indra/llrender/llfontregistry.h
+++ b/indra/llrender/llfontregistry.h
@@ -34,22 +34,45 @@ class LLFontGL;
typedef std::vector<std::string> string_vec_t;
+enum class EFontHinting : S32
+{
+ DEFAULT = 0,
+ NO_HINTING = 0x8000U,
+ FORCE_AUTOHINT = 0x20,
+};
+
struct LLFontFileInfo
{
- LLFontFileInfo(const std::string& file_name, const std::function<bool(llwchar)>& char_functor = nullptr)
+ LLFontFileInfo(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::function<bool(llwchar)>& char_functor = nullptr)
: FileName(file_name)
, CharFunctor(char_functor)
+ , mHinting(hinting)
+ , mFlags(flags)
+ , mSizeDelta(size_delta)
+ , mWeight(weight)
{
}
- LLFontFileInfo(const LLFontFileInfo& ffi)
+ LLFontFileInfo(const LLFontFileInfo& ffi, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight)
: FileName(ffi.FileName)
, CharFunctor(ffi.CharFunctor)
+ , mHinting(hinting)
+ , mFlags(flags)
+ , mSizeDelta(size_delta)
+ , mWeight(weight)
{
}
std::string FileName;
std::function<bool(llwchar)> CharFunctor;
+ EFontHinting mHinting;
+ S32 mFlags;
+ S32 mWeight; // -1 - default, whatever is in the file.
+
+ // Not all fonts are the same size, Ex: dejavu is bigger than inter,
+ // so in some cases we want to adjust relative sizes to make characters
+ // from different files match.
+ F32 mSizeDelta;
};
typedef std::vector<LLFontFileInfo> font_file_info_vec_t;
@@ -71,10 +94,10 @@ public:
const std::string& getSize() const { return mSize; }
void setSize(const std::string& size) { mSize = size; }
- void addFontFile(const std::string& file_name, const std::string& char_functor = LLStringUtil::null);
+ void addFontFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::string& char_functor = LLStringUtil::null);
const font_file_info_vec_t & getFontFiles() const { return mFontFiles; }
void setFontFiles(const font_file_info_vec_t& font_files) { mFontFiles = font_files; }
- void addFontCollectionFile(const std::string& file_name, const std::string& char_functor = LLStringUtil::null);
+ void addFontCollectionFile(const std::string& file_name, EFontHinting hinting, S32 flags, F32 size_delta, S32 weight, const std::string& char_functor = LLStringUtil::null);
const font_file_info_vec_t& getFontCollectionFiles() const { return mFontCollectionFiles; }
void setFontCollectionFiles(const font_file_info_vec_t& font_collection_files) { mFontCollectionFiles = font_collection_files; }