Skip to content

fontconfig can't find the default font after compilation #310

Open
@rambip

Description

@rambip

Describe the bug

I am not able to run the first bitmap example because fontconfig doesn't work :
image

To Reproduce
here is a nix expression I used:

{ pkgs ? import <nixpkgs> {} }:
  let
  moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
  pkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
  channel = pkgs.rustChannelOf {
     date = "2021-11-01";
     channel = "nightly";
  };
  rust = (channel.rust.override {
    targets = [ "wasm32-unknown-unknown" ];
    extensions = ["rust-src" "rust-analysis"];
  });
in
  with pkgs;
  pkgs.mkShell {
    name = "rust-env";
    buildInputs = [
      pkg-config
      freetype
      cmake
      expat
      rust
    ];
    shellHook = 
    let fonts = makeFontsConf { fontDirectories = [ open-sans freefont_ttf fira fira-mono ]; }; 
    in ''
    export FONTCONFIG_FILE=${fonts}
    fc-cache -f
    '';
}

Version Information
Here is my Cargo.toml:

[package]
name = "simu_elec"
version = "0.1.0"
edition = "2021"

[dependencies.plotters]
version="0.3.1"
default-features=false
features = ["bitmap_backend", "line_series"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions