Discussion:
[chromium-dev] Bundle font file for test purpose
'Linkun Chen' via Chromium-dev
2018-11-26 17:40:40 UTC
Permalink
Hi all,

I am from chromecast team, and I have a question about font in test.

I need a special font (Google Sans) while testing UI, the resource file can
be bundled in pak file.
How can I force fontconfig to load a font file I provided? I
found FcConfigAppFontAddFile() but it only takes path to the file, however
my resource is in pak file.

1. Install Google Sans on the x86 machine running test.
2. Read from pak file and write to a tmp file on disk, then
call FcConfigAppFontAddFile() to load it.
3. any other suggestions?

Thanks
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/de044b78-643c-4cb1-8d49-9c4c6225a547%40chromium.org.
'Linkun Chen' via Chromium-dev
2018-11-30 01:00:00 UTC
Permalink
friendly ping
Post by 'Linkun Chen' via Chromium-dev
Hi all,
I am from chromecast team, and I have a question about font in test.
I need a special font (Google Sans) while testing UI, the resource file
can be bundled in pak file.
How can I force fontconfig to load a font file I provided? I
found FcConfigAppFontAddFile() but it only takes path to the file, however
my resource is in pak file.
1. Install Google Sans on the x86 machine running test.
2. Read from pak file and write to a tmp file on disk, then
call FcConfigAppFontAddFile() to load it.
3. any other suggestions?
Thanks
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/e0f90b4d-823c-4cb4-b60c-cac19b05035e%40chromium.org.
Peter Kasting
2018-11-30 01:01:23 UTC
Permalink
Is there a way to avoid using Google Sans specifically in your testing?
Perhaps you could say more about why the test has to test that font.

PK
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAHOzFCQcSy3zjvUOFN2FKoqW-8TKWGpaFbtRehMNpGmLYFVwg%40mail.gmail.com.
'Linkun Chen' via Chromium-dev
2018-11-30 01:08:43 UTC
Permalink
We need that specific font. The font is part of our UI design, we want the
screenshot to be pixel-to-pixel same as our expectation.
Post by Peter Kasting
Is there a way to avoid using Google Sans specifically in your testing?
Perhaps you could say more about why the test has to test that font.
PK
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d3fa7a26-c311-4c1d-82cc-489403763d39%40chromium.org.
Peter Kasting
2018-11-30 01:44:49 UTC
Permalink
On Thu, Nov 29, 2018 at 5:08 PM 'Linkun Chen' via Chromium-dev <
Post by 'Linkun Chen' via Chromium-dev
We need that specific font. The font is part of our UI design, we want the
screenshot to be pixel-to-pixel same as our expectation.
So you're doing a test by screenshotting and pixel diffing against a
reference? That will start failing if anyone changes anything for any
reason (i.e. it's a change detector test, which is generally discouraged).
What is the underlying thing you want to test about the UI? Perhaps this
could be broken into a set of unittests that don't do pixel diffs.

PK
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAHOzFAc80uhMSKcNwnQTZYxCJ0xkEHyuC2JMm1bLDgqKBL9tw%40mail.gmail.com.
Sergey Ulanov
2018-12-07 20:17:03 UTC
Permalink
Layout tests on Android and Linux use fonts from //third_party/test_fonts ,
so if you need Google Sans in layout tests you just need to add it in
//third_party/test_fonts and then update
//base/test/fontconfig_util_linux.cc and
//content/shell/test_runner/resources/fonts/android_main_fonts.xml to
register the new font. If you need this font in some tests other than
layout tests then you still can use //third_party/test_fonts . The tests
just need to call base::SetUpFontconfig() to initialize fontconfig with the
test fonts.

On Mon, Nov 26, 2018 at 11:11 AM 'Linkun Chen' via Chromium-dev <
Post by 'Linkun Chen' via Chromium-dev
Hi all,
I am from chromecast team, and I have a question about font in test.
I need a special font (Google Sans) while testing UI, the resource file
can be bundled in pak file.
How can I force fontconfig to load a font file I provided? I
found FcConfigAppFontAddFile() but it only takes path to the file, however
my resource is in pak file.
1. Install Google Sans on the x86 machine running test.
2. Read from pak file and write to a tmp file on disk, then
call FcConfigAppFontAddFile() to load it.
3. any other suggestions?
Thanks
--
--
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups
"Chromium-dev" group.
To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/de044b78-643c-4cb1-8d49-9c4c6225a547%40chromium.org
<https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/de044b78-643c-4cb1-8d49-9c4c6225a547%40chromium.org?utm_medium=email&utm_source=footer>
.
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CA%2B1DSjhKBV49N84vmcca-Ckd4W-PJ2uucC6Qk2R5vLK%3DZuzgCQ%40mail.gmail.com.
Loading...