Instead of stamping a bunch of FCC IDs and stuff on a piece of hardware, manufacturers can use digital regulatory labels (E-labels). If present on the machine, the label is displayed in chrome://chrome (aka chrome://settings/help). Eve and Samus are the only two boards that do this.
The whole label is one image. The boring regulatory text is part of the image.
This makes it hard to match to the Settings font. It also means the a11y text
needs to duplicate all that text in addition to the weird regulatory logos
("marks").
The image needs to be sized very specifically to look correct, since Settings
displays it at a fixed width.
This is a pain for developers (me) that was put together ad-hoc by some developer
(me) to handle the first label we had. So I propose someone (me) improve the
workflow for future developers (me). ;-)
Here's how it works today:
1. Someone creates the label image. This should include the boring text and the
weird regulatory logos. We can't display the text separately.
The image needs to be large enough to adapt to physical pixel density. We
use a "2x" version for samus and eve. Example for Eve attached.
2. A developer ensures the image displays nicely at 330px. For Eve, I extended
the given image to 660px (by adding transparent space on the right). This
ensures it looks "normal" at 330px -- see step 5.
3. The image (label.png) and the a11y text (label.txt) are placed in the
chromeos-assets project at chromeos-assets/regulatory_labels/$BOARD/$REGION.
For example, the Samus image is at:
chromeos-assets/regulatory_labels/samus/us/label.png.
4. When building an image for $BOARD, these assets are copied into the image by
chromeos-assets-9999.ebuild. They live in /usr/share/chromeos-assets, i.e.:
/usr/share/chromeos-assets/regulatory_labels/us/label.png
/usr/share/chromeos-assets/regulatory_labels/us/label.txt
5. Chrome Settings WebUI looks for the label on disk. If found, it displays it
as a 330-px wide image: https://cs.chromium.org/chromium/src/chrome/browser/resources/settings/about_page/about_page.html?type=cs&sq=package:chromium&q=regulatoryInfo&l=74-76
Here's how it SHOULD work:
1. The label will consist of lines of regular text, followed by an image for the
weird regulatory logos. This way the text doesn't have to be part of the image
itself. (The text is optional, so we don't have to change eve and samus if we
don't want to.)
2. The image will be provided to the developer at the exact dimensions it should
be displayed at, scaled for physical pixel density. Again, the attachment is a
good example. (The Samus label was huge which is why Settings had to scale it
to 330px.)
3. The regular text (text.txt), image (label.png) and a11y text for the image
(label.txt) will be placed in chromeos-assets/regulatory_labels/$BOARD/$REGION
as before, and copied to /usr/share/chromeos-assets when building, as before.
The "text.txt" file is new here, it holds the normal-text lines that should be
shown above the weird regulatory logos.
4. Chrome Settings WebUI will display the image, scaled by 1/2 to account for
physical pixel density.
Here's how we get there:
1. Resize the samus logo to 660px so it looks natural at 330px.
2. Update Settings to display the logo at 1/2 scale instead of using a fixed
pixel width.
3. Add logic to read the "text.txt" file and show those lines above the label
in Settings.
4. Optionally, remove the text from the samus and eve logos and add it to
"text.txt" files for those boards, so the text becomes crisper and more
natural.
After we do this, I'll add internal documentation for it so adding labels in the
future won't require developers to root through old CLs and bugs.
|
Deleted:
eve-label-source-2x.png
19.6 KB
|
Comment 1 Deleted