First shot at fixing font fallback
This commit is contained in:
@@ -193,6 +193,8 @@ BOOL LLFont::loadFace(const std::string& filename, const F32 point_size, const F
|
|||||||
mFTFace = NULL;
|
mFTFace = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
llinfos << "Loading font file: " << filename << llendl;
|
||||||
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = FT_New_Face( gFTLibrary,
|
error = FT_New_Face( gFTLibrary,
|
||||||
|
|||||||
@@ -384,9 +384,13 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
|
|||||||
// This may not be the best solution, but it at least prevents a crash.
|
// This may not be the best solution, but it at least prevents a crash.
|
||||||
if (it != mFontMap.end() && it->second != NULL)
|
if (it != mFontMap.end() && it->second != NULL)
|
||||||
{
|
{
|
||||||
llinfos << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << llendl;
|
if (it->second != NULL) {
|
||||||
|
llinfos << "-- matching font exists: " << nearest_exact_desc.getName() << " size " << nearest_exact_desc.getSize() << " style " << ((S32) nearest_exact_desc.getStyle()) << llendl;
|
||||||
|
|
||||||
return it->second;
|
return it->second;
|
||||||
|
} else {
|
||||||
|
llwarns << "Failed to find font" << llendl;
|
||||||
|
}
|
||||||
//Haven't plugged free-type in yet.
|
//Haven't plugged free-type in yet.
|
||||||
// copying underlying Freetype font, and storing in LLFontGL with requested font descriptor
|
// copying underlying Freetype font, and storing in LLFontGL with requested font descriptor
|
||||||
/*LLFontGL *font = new LLFontGL;
|
/*LLFontGL *font = new LLFontGL;
|
||||||
@@ -408,6 +412,7 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
|
|||||||
file_names.insert(file_names.end(),
|
file_names.insert(file_names.end(),
|
||||||
match_default_desc->getFileNames().begin(),
|
match_default_desc->getFileNames().begin(),
|
||||||
match_default_desc->getFileNames().end());
|
match_default_desc->getFileNames().end());
|
||||||
|
llinfos << "Found matching fallback fonts: " << match_default_desc->getFileNames().size() << llendl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add ultimate fallback list - generated dynamically on linux,
|
// Add ultimate fallback list - generated dynamically on linux,
|
||||||
|
|||||||
@@ -2564,7 +2564,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
|
|||||||
// Use libfontconfig to find us a nice ordered list of fallback fonts
|
// Use libfontconfig to find us a nice ordered list of fallback fonts
|
||||||
// specific to this system.
|
// specific to this system.
|
||||||
std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf");
|
std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf");
|
||||||
const int max_font_count_cutoff = 40; // fonts are expensive in the current system, don't enumerate an arbitrary number of them
|
const int max_font_count_cutoff = 100; // fonts are expensive in the current system, don't enumerate an arbitrary number of them
|
||||||
// Our 'ideal' font properties which define the sorting results.
|
// Our 'ideal' font properties which define the sorting results.
|
||||||
// slant=0 means Roman, index=0 means the first face in a font file
|
// slant=0 means Roman, index=0 means the first face in a font file
|
||||||
// (the one we actually use), weight=80 means medium weight,
|
// (the one we actually use), weight=80 means medium weight,
|
||||||
@@ -2654,7 +2654,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
|
|||||||
}
|
}
|
||||||
llinfos << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << llendl;
|
llinfos << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << llendl;
|
||||||
|
|
||||||
rtns.push_back(final_fallback);
|
//rtns.push_back(final_fallback);
|
||||||
return rtns;
|
return rtns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6654,72 +6654,6 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<real>0.5</real>
|
<real>0.5</real>
|
||||||
</map>
|
</map>
|
||||||
<key>FontMonospace</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Name of monospace font that definitely exists (Truetype file name)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>String</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<string>DejaVuSansMono.ttf</string>
|
|
||||||
</map>
|
|
||||||
<key>FontSansSerif</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Name of primary sans-serif font that definitely exists (Truetype file name)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>String</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<string>DroidSans.ttf</string>
|
|
||||||
</map>
|
|
||||||
<key>FontSansSerifBundledFallback</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Name of secondary sans-serif font that definitely exists (Truetype file name)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>String</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<string>DejaVuSansCondensed.ttf</string>
|
|
||||||
</map>
|
|
||||||
<key>FontSansSerifBold</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Name of bold font (Truetype file name)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>String</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<string>DroidSans-Bold.ttf</string>
|
|
||||||
</map>
|
|
||||||
<key>FontSansSerifFallback</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Name of sans-serif font (Truetype file name)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>String</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<string/>
|
|
||||||
</map>
|
|
||||||
<key>FontSansSerifFallbackScale</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Scale of fallback font relative to huge font (fraction of huge font size)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>F32</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<real>1.00</real>
|
|
||||||
</map>
|
|
||||||
<key>FontScreenDPI</key>
|
<key>FontScreenDPI</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
@@ -6731,61 +6665,6 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<real>96.0</real>
|
<real>96.0</real>
|
||||||
</map>
|
</map>
|
||||||
<key>FontSizeHuge</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Size of huge font (points, or 1/72 of an inch)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>F32</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<real>14.0</real>
|
|
||||||
</map>
|
|
||||||
<key>FontSizeLarge</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Size of large font (points, or 1/72 of an inch)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>F32</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<real>11.0</real>
|
|
||||||
</map>
|
|
||||||
<key>FontSizeMedium</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Size of medium font (points, or 1/72 of an inch)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>F32</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<real>9.5</real>
|
|
||||||
</map>
|
|
||||||
<key>FontSizeMonospace</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Size of monospaced font (points, or 1/72 of an inch)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>F32</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<real>9.0</real>
|
|
||||||
</map>
|
|
||||||
<key>FontSizeSmall</key>
|
|
||||||
<map>
|
|
||||||
<key>Comment</key>
|
|
||||||
<string>Size of small font (points, or 1/72 of an inch)</string>
|
|
||||||
<key>Persist</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
<key>Type</key>
|
|
||||||
<string>F32</string>
|
|
||||||
<key>Value</key>
|
|
||||||
<real>8.5</real>
|
|
||||||
</map>
|
|
||||||
<key>ForceNotecardDragCargoPermissive</key>
|
<key>ForceNotecardDragCargoPermissive</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user