Commit e5d43058 authored by Alex Turner's avatar Alex Turner Committed by Chromium LUCI CQ

Add a digest of the PostScript name string to the FontIndexer

This will expand the number of IdentifiableSurfaces trivially
constructible from the FontIndexer's output, namely digests with type
kLocalFontLoadPostScriptName and kLocalFontExistenceByUniqueNameOnly.

Bug: 1155635
Change-Id: I6b602c808f1c22ed3e14d87e91dfdc5d7c77aae9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575004
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834375}
parent aa3b0d88
......@@ -84,7 +84,7 @@ const std::pair<blink::FontSelectionValue, std::string>
const char kOutputHeader[] =
"Family name\tPostScript name\tweight\twidth\tslope\ttypeface "
"digest\tdefault family name lookup digest\tdefault PostScript name lookup "
"digest";
"digest\tPostScript name string digest";
const char kOutputSeparator[] = "\t";
FontIndexer::FontIndexer() : font_cache_(blink::FontCache::GetFontCache()) {}
......@@ -269,6 +269,9 @@ void FontIndexer::PrintAllFontsWithName(WTF::AtomicString name) {
default_postscript_name_lookup_digest =
builder.GetToken().ToUkmMetricValue();
}
uint64_t postscript_name_string_digest =
blink::IdentifiabilityBenignStringToken(postscript_name)
.ToUkmMetricValue();
std::cout << name.Ascii() << kOutputSeparator
<< postscript_name.Ascii() << kOutputSeparator
......@@ -277,7 +280,9 @@ void FontIndexer::PrintAllFontsWithName(WTF::AtomicString name) {
<< slope_pair.second << kOutputSeparator
<< typeface_digest << kOutputSeparator
<< default_family_name_lookup_digest << kOutputSeparator
<< default_postscript_name_lookup_digest << std::endl;
<< default_postscript_name_lookup_digest
<< kOutputSeparator << postscript_name_string_digest
<< std::endl;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment