recovery_ui/font.rs
1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use carnelian::drawing::{FontFace, load_font};
6use std::path::PathBuf;
7use std::sync::LazyLock;
8
9const DEFAULT_FONT_PATH: &str = "/pkg/data/fonts/Roboto-Regular.ttf";
10
11static FONT_FACE: LazyLock<FontFace> = LazyLock::new(|| {
12 load_font(PathBuf::from(DEFAULT_FONT_PATH)).expect("failed to open font file")
13});
14
15pub fn get_default_font_face() -> &'static FontFace {
16 &FONT_FACE
17}