Skip to content

Commit

Permalink
opentrons-ot3-image.bb: add Chinese locale and font to support locali…
Browse files Browse the repository at this point in the history
…zation (#174)
  • Loading branch information
vegano1 authored Nov 19, 2024
1 parent 47d0645 commit b4f209d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<fontconfig>
<!--
- Medium variant is used instead of Regular on Qt apps:
https://bugs.launchpad.net/ubuntu-font-family/+bug/744812
- Medium and Bold looks the same in certain applications:
https://bugs.launchpad.net/ubuntu/+source/gnome-specimen/+bug/813373
-->
<match target="scan">
<test name="fullname" compare="eq">
<string>Source Han Sans CN Medium</string>
</test>
<edit name="weight" mode="assign">
<const>demibold</const>
</edit>
</match>
</fontconfig>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SUMMARY = "Adobe OpenType region specific font family for Simplified Chinese"
HOMEPAGE = "https://github.com/adobe-fonts/source-han-sans"
LICENSE = "OFL-1.1"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/${LICENSE};md5=fac3a519e5e9eb96316656e0ca4f2b90"

inherit allarch fontcache

SRC_URI = " \
file://SourceHanSansCN-VF.ttf \
file://44-source-han-sans-cn.conf \
"
SRC_URI[md5sum] = "80056a18882059d0f7d5616a929ca8a8"
SRC_URI[sha256sum] = "e7ed74bc82eddfb62bc9a09b7e850731ea40da8e8a1b530318c3fe395045ae6d"

do_install() {
install -d ${D}${sysconfdir}/fonts/conf.d/
install -m 0644 ${WORKDIR}/44-source-han-sans-cn.conf ${D}${sysconfdir}/fonts/conf.d/

install -d ${D}${datadir}/fonts/ttf
install -m 0644 ${WORKDIR}/SourceHanSansCN-VF.ttf ${D}${datadir}/fonts/ttf/
}

FILES:${PN} = " \
${sysconfdir}/fonts \
${datadir}/fonts \
${datadir}/fonts/ttf \
"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ DEPENDS += "rsync-native zip-native \
"
IMAGE_FSTYPES += "ext4.xz teziimg"

IMAGE_LINGUAS = "en-us"
IMAGE_LINGUAS = "en-us zh-cn"
GLIBC_GENERATE_LOCALES = "zh_CN.UTF-8 en_GB.UTF-8 en_US.UTF-8"
LOCALE_UTF8_ONLY="1"
# Copy Licenses to image /usr/share/common-license
COPY_LIC_MANIFEST ?= "1"
COPY_LIC_DIRS ?= "1"
Expand Down Expand Up @@ -42,6 +44,7 @@ IMAGE_INSTALL += " \
packagegroup-fsl-isp \
udev-extraconf \
v4l-utils dfu-util \
source-han-sans-cn-fonts \
bash coreutils makedevs mime-support util-linux \
timestamp-service networkmanager crda ch341ser \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'timestamp-service systemd-analyze', '', d)} \
Expand Down

0 comments on commit b4f209d

Please sign in to comment.