.ttf fonts not present in outputs of presentation to PDF conversion in Docker

I have a Docker container which installs LibreOffice and some Google fonts (e.g. OpenSans[wdth,wght].tff). The image is used within an AWS Lambda.

This is the image:

FROM public.ecr.aws/lambda/nodejs:18 AS build
WORKDIR /`enter code here`var/build

ENV NODE_ENV=production
RUN yum -y install tar gzip xorg-x11-font-utils fontconfig make gcc unzip

# Install Google fonts
ADD fonts-main.zip /tmp/fonts-main.zip
RUN unzip /tmp/fonts-main.zip -d /tmp/fonts-main && rm /tmp/fonts-main.zip
RUN find /tmp/ -iname '*.ttf' -exec cp {} /usr/share/fonts/ \;
RUN fc-cache /usr/share/fonts

# Install LibreOffice
WORKDIR /var/build
RUN curl -L -o LibreOffice.tar.gz https://downloadarchive.documentfoundation.org/libreoffice/old/${LIBREOFFICE_VERSION_LONG}/rpm/x86_64/LibreOffice_${LIBREOFFICE_VERSION_LONG}_Linux_x86-64_rpm.tar.gz
RUN tar -xf LibreOffice.tar.gz
RUN yum -y install LibreOffice_${LIBREOFFICE_VERSION_LONG}_Linux_x86-64_rpm/RPMS/*.rpm
RUN mv /opt/libreoffice${LIBREOFFICE_VERSION_LOCAL} /opt/libreoffice
COPY src/ /var/build/
RUN npm install

# Build the final runtime container
FROM public.ecr.aws/lambda/nodejs:18 AS runtime
WORKDIR /var/task
COPY --from=build /opt/libreoffice /opt/libreoffice
COPY --from=build /var/build/node_modules/ /var/task/node_modules/
COPY --from=build /usr/share/fonts /usr/share/fonts
COPY src/ /var/task/
RUN rpm --import https://yum.corretto.aws/corretto.key && curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo && yum -y install java-20-amazon-corretto-devel libXinerama dbus-libs cairo-devel cups && yum clean all

CMD ["index.handler"]

The JS for the Lambda function uses LibreOffice to convert a given document (.docx, .doc, .odt etc), spreadsheet (.xlsx, .xlx, .ods etc) or presentation (.pptx, .ppt, .opt etc) to PDF via the command-line: `/opt/libreoffice/program/soffice --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp/work ‘${filePath}’

When I trigger the Lambda and get it to convert a presentation which has a font in the fonts zip, it does not use it at all and it falls back to a default font.

I ran the container locally, it also did not render the fonts for the presentation in the PDF like in AWS Lambda.

I installed LibreOffice in my WSL which uses Fedora OS and used the command-line to convert the same slideshow to PDF, the fonts rendered correctly there.

I also tried converting a document which used the exact same fonts in the AWS Lambda and local container, and WSL, the fonts rendered as expected in all of these places.

So, it just seems to be presentations which utilise installed ttf fonts in a container which don’t render as expected. What could be causing this?