3
votes

I'm using Gitlab Pages to host a Doxygen-created API for my project. I also leverage the graphviz project to create dependency graphs. I use the CI script to install the packages and build the documentation:

pages:
  stage: build
  image: alpine
  script:
    - apk update && apk add doxygen
    - apk add graphviz
    - doxygen doxy/dox_config
    - mv docs/html/ public/
  artifacts:
    paths:
      - public
  only:
    - master
  dependencies: []

The CI script runs without any errors other than a Doxygen error complaining it can't find LaTeX and dvips, neither of which should affect the graphviz pictures. My graphs look like the following:

Graphviz Problems

I'm not really sure what the problem is or how to fix it. Why are all the characters wrong?

2
Have the same problem, I'll try your solution. For future readers: I solved the LaTeX problem by switching to MathJax in doxygen config, I thought it was more relevant than requesting a whole LaTeX install in the docker image.kebs

2 Answers

3
votes

It turns out the issue is with the Docker image used. Alpine doesn't include the correct fonts, but Debian has all the prerequisites. While there is almost definitely a way to install the fonts with Alpine, I just switched to the Debian docker image. Here is a working YML script:

pages:
  stage: build
  image: ubuntu:trusty
  script:
    - export DEBIAN_FRONTEND=noninteractive
    - apt-get -yq update
    - apt-get -yq install graphviz
    - apt-get -yq install doxygen
    - doxygen doxy/dox_config
    - mv docs/html/ public/
  artifacts:
    paths:
      - public
1
votes

Installing either the package ttf-freefont or ttf-ubuntu-font-family will fix the problem. Here is my Dockerfile

FROM alpine:3.6

RUN apk --update add \
  doxygen \
  graphviz \
  ttf-freefont \
  && rm -rf /var/cache/apk/*

ttf-ubuntu-font-family is more narrow font, so your boxes will become a bit smaller.