@@ -387,12 +387,12 @@ bool PangoFontInfo::GetSpacingProperties(const string& utf8_char,
387
387
}
388
388
389
389
bool PangoFontInfo::CanRenderString (const char * utf8_word, int len) const {
390
- vector<string> graphemes;
390
+ std:: vector<string> graphemes;
391
391
return CanRenderString (utf8_word, len, &graphemes);
392
392
}
393
393
394
394
bool PangoFontInfo::CanRenderString (const char * utf8_word, int len,
395
- vector<string>* graphemes) const {
395
+ std:: vector<string>* graphemes) const {
396
396
if (graphemes) graphemes->clear ();
397
397
// We check for font coverage of the text first, as otherwise Pango could
398
398
// (undesirably) fall back to another font that does have the required
@@ -508,7 +508,7 @@ bool PangoFontInfo::CanRenderString(const char* utf8_word, int len,
508
508
509
509
510
510
// ------------------------ FontUtils ------------------------------------
511
- vector<string> FontUtils::available_fonts_; // cache list
511
+ std:: vector<string> FontUtils::available_fonts_; // cache list
512
512
513
513
// Returns whether the specified font description is available in the fonts
514
514
// directory.
@@ -591,7 +591,7 @@ static bool ShouldIgnoreFontFamilyName(const char* query) {
591
591
592
592
// Outputs description names of available fonts.
593
593
/* static */
594
- const vector<string>& FontUtils::ListAvailableFonts () {
594
+ const std:: vector<string>& FontUtils::ListAvailableFonts () {
595
595
if (!available_fonts_.empty ()) {
596
596
return available_fonts_;
597
597
}
@@ -634,13 +634,13 @@ const vector<string>& FontUtils::ListAvailableFonts() {
634
634
g_free (faces);
635
635
}
636
636
g_free (families);
637
- sort (available_fonts_.begin (), available_fonts_.end ());
637
+ std:: sort (available_fonts_.begin (), available_fonts_.end ());
638
638
return available_fonts_;
639
639
}
640
640
641
641
642
642
static void CharCoverageMapToBitmap (PangoCoverage* coverage,
643
- vector<bool >* unichar_bitmap) {
643
+ std:: vector<bool >* unichar_bitmap) {
644
644
const int kMinUnicodeValue = 33 ;
645
645
const int kMaxUnicodeValue = 0x10FFFF ;
646
646
unichar_bitmap->resize (kMaxUnicodeValue + 1 , false );
@@ -654,23 +654,23 @@ static void CharCoverageMapToBitmap(PangoCoverage* coverage,
654
654
}
655
655
656
656
/* static */
657
- void FontUtils::GetAllRenderableCharacters (vector<bool >* unichar_bitmap) {
658
- const vector<string>& all_fonts = ListAvailableFonts ();
657
+ void FontUtils::GetAllRenderableCharacters (std:: vector<bool >* unichar_bitmap) {
658
+ const std:: vector<string>& all_fonts = ListAvailableFonts ();
659
659
return GetAllRenderableCharacters (all_fonts, unichar_bitmap);
660
660
}
661
661
662
662
/* static */
663
663
void FontUtils::GetAllRenderableCharacters (const string& font_name,
664
- vector<bool >* unichar_bitmap) {
664
+ std:: vector<bool >* unichar_bitmap) {
665
665
PangoFontInfo font_info (font_name);
666
666
PangoCoverage* coverage =
667
667
pango_font_get_coverage (font_info.ToPangoFont (), nullptr );
668
668
CharCoverageMapToBitmap (coverage, unichar_bitmap);
669
669
}
670
670
671
671
/* static */
672
- void FontUtils::GetAllRenderableCharacters (const vector<string>& fonts,
673
- vector<bool >* unichar_bitmap) {
672
+ void FontUtils::GetAllRenderableCharacters (const std:: vector<string>& fonts,
673
+ std:: vector<bool >* unichar_bitmap) {
674
674
// Form the union of coverage maps from the fonts
675
675
PangoCoverage* all_coverage = pango_coverage_new ();
676
676
tlog (1 , " Processing %d fonts\n " , fonts.size ());
@@ -691,7 +691,7 @@ void FontUtils::GetAllRenderableCharacters(const vector<string>& fonts,
691
691
/* static */
692
692
int FontUtils::FontScore (const std::unordered_map<char32, inT64>& ch_map,
693
693
const string& fontname, int * raw_score,
694
- vector<bool >* ch_flags) {
694
+ std:: vector<bool >* ch_flags) {
695
695
PangoFontInfo font_info;
696
696
if (!font_info.ParseFontDescriptionName (fontname)) {
697
697
tprintf (" ERROR: Could not parse %s\n " , fontname.c_str ());
@@ -723,22 +723,23 @@ int FontUtils::FontScore(const std::unordered_map<char32, inT64>& ch_map,
723
723
724
724
725
725
/* static */
726
- string FontUtils::BestFonts (const std::unordered_map<char32, inT64>& ch_map,
727
- vector<pair<const char *, vector<bool > > >* fonts) {
726
+ string FontUtils::BestFonts (
727
+ const std::unordered_map<char32, inT64>& ch_map,
728
+ std::vector<std::pair<const char *, std::vector<bool > > >* fonts) {
728
729
const double kMinOKFraction = 0.99 ;
729
730
// Weighted fraction of characters that must be renderable in a font to make
730
731
// it OK even if the raw count is not good.
731
732
const double kMinWeightedFraction = 0.99995 ;
732
733
733
734
fonts->clear ();
734
- vector<vector<bool > > font_flags;
735
- vector<int > font_scores;
736
- vector<int > raw_scores;
735
+ std:: vector<std:: vector<bool > > font_flags;
736
+ std:: vector<int > font_scores;
737
+ std:: vector<int > raw_scores;
737
738
int most_ok_chars = 0 ;
738
739
int best_raw_score = 0 ;
739
- const vector<string>& font_names = FontUtils::ListAvailableFonts ();
740
+ const std:: vector<string>& font_names = FontUtils::ListAvailableFonts ();
740
741
for (int i = 0 ; i < font_names.size (); ++i) {
741
- vector<bool > ch_flags;
742
+ std:: vector<bool > ch_flags;
742
743
int raw_score = 0 ;
743
744
int ok_chars = FontScore (ch_map, font_names[i], &raw_score, &ch_flags);
744
745
most_ok_chars = MAX (ok_chars, most_ok_chars);
@@ -767,7 +768,7 @@ string FontUtils::BestFonts(const std::unordered_map<char32, inT64>& ch_map,
767
768
int raw_score = raw_scores[i];
768
769
if ((score >= least_good_enough && raw_score >= least_raw_enough) ||
769
770
score >= override_enough) {
770
- fonts->push_back (make_pair (font_names[i].c_str (), font_flags[i]));
771
+ fonts->push_back (std:: make_pair (font_names[i].c_str (), font_flags[i]));
771
772
tlog (1 , " OK font %s = %.4f%%, raw = %d = %.2f%%\n " ,
772
773
font_names[i].c_str (),
773
774
100.0 * score / most_ok_chars,
@@ -786,20 +787,20 @@ string FontUtils::BestFonts(const std::unordered_map<char32, inT64>& ch_map,
786
787
787
788
/* static */
788
789
bool FontUtils::SelectFont (const char * utf8_word, const int utf8_len,
789
- string* font_name, vector<string>* graphemes) {
790
+ string* font_name, std:: vector<string>* graphemes) {
790
791
return SelectFont (utf8_word, utf8_len, ListAvailableFonts (), font_name,
791
792
graphemes);
792
793
}
793
794
794
795
/* static */
795
796
bool FontUtils::SelectFont (const char * utf8_word, const int utf8_len,
796
- const vector<string>& all_fonts,
797
- string* font_name, vector<string>* graphemes) {
797
+ const std:: vector<string>& all_fonts,
798
+ string* font_name, std:: vector<string>* graphemes) {
798
799
if (font_name) font_name->clear ();
799
800
if (graphemes) graphemes->clear ();
800
801
for (int i = 0 ; i < all_fonts.size (); ++i) {
801
802
PangoFontInfo font;
802
- vector<string> found_graphemes;
803
+ std:: vector<string> found_graphemes;
803
804
ASSERT_HOST_MSG (font.ParseFontDescriptionName (all_fonts[i]),
804
805
" Could not parse font desc name %s\n " ,
805
806
all_fonts[i].c_str ());
0 commit comments