Cambiar fuentes en Typst

Uso y configuración

La salida de los documentos de Quarto se configura a través de metadatos en el encabezado YAML. Para especificar un formato de salida para tu documento. Aquí tienes un ejemplo de encabezado YAML:

---
title: |
  Análisis Estadísticos 
  
  con Quarto-Typst
author: Marta García González
#author: "Pedro L. Luque Calvo, Marta García González"
lang: es
date: today
date-format: full
bibliography: referencias2.bib
#csl: apa
#csl: chicago-author-date
format:
  memoriatfetypst-typst: 
    toc: false
    #sectionnumbering: "1"
    keep-typ: true
    tofiguras: false
    totablas: false
    papersize: a4
    portada: false
    #logo: "logo.png"
    facultad: "Facultad de Matemáticas"
    universidad: "Universidad de Sevilla"
    tutor-TFG: "Tutor: Pedro L. Luque"
    fecha-TFG: "Sevilla, Junio de 2026"
    nombre-capitulo: "--"
    apendice-portada: "Apéndice"
    apendice-nombre: "Apéndice"
    referencias-nombre: "Referencias"
    cabecera-capitulo: "estilo03"
    toccapitulos: true
    bibliografia-completa: false
  html:
    toc: true
    toc-title: "Tabla de Contenidos"
    number-sections: true
    code-tools: 
      source: true
    embed-resources: true
brand: 
  typography:
    fonts:
      - family: Jost
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Pacifico
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Barlow
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Merriweather
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: "Roboto Condensed"
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: SUSE Mono
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Libertinus Sans
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Noto Sans Math
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Libertinus Serif
        source: file
        files:
          - path: static/fonts/Libertinus-7.051/static/OTF/LibertinusSerif-Regular.otf
          - path: static/fonts/Libertinus-7.051/static/OTF/LibertinusSerif-Italic.otf
            style: italic
      - family: Libertinus Math
        source: file
        files:
          - path: static/fonts/Libertinus-7.051/static/OTF/LibertinusMath-Regular.otf
    #base: Libertinus Serif
    #base: Calibri
    #base: Chalkboard
    #base: DejaVu Sans Mono 
    #base: New Computer Modern
    #base: Lato
    #base: Roboto
    #base: Open Sans
    #base: Merriweather
    #base: "Roboto Condensed"
    #base: Pacifico
    #base: SUSE Mono
    base: Libertinus Sans
    #base: Barlow
    # DejaVu Sans Mono
    # Libertinus Serif
    # New Computer Modern
    # New Computer Modern Math
    #base: Jost
    #headings: Jost
    #headings: Libertinus Serif
    headings: Pacifico
    #headings: SUSE Mono
  defaults:
    memoriatfetypst-typst:
      #mathfont: Libertinus Math
      #mathfont: Noto Sans Math
      mathfont: New Computer Modern Math
execute:
  warning: false
  message: false
---

Cómo cambiar las fuentes

En la cabecera YAML del documento, dentro de la sección brand: typography: fonts: puede especificar las fuentes que se desee utilizar en su documento.

Fuentes desde Google Fonts

Para usar fuentes de Google Fonts, puedes especificar el nombre de la familia de fuentes y los pesos que deseas incluir. Por ejemplo, para usar la fuente “Jost” y “Pacifico” de Google Fonts, puedes hacerlo así:

brand: 
  typography:
    fonts:
      - family: Jost
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
      - family: Pacifico
        source: google
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]

Las fuentes Google disponibles se puede consultar en: https://fonts.google.com/. Los pasos a seguir habitualmente son:

  1. Buscar la fuente en Google Fonts y anotar el nombre de la familia.

  2. Añadir al apartado fonts: la fuente con su nombre y pesos deseados, aunque generalmente sería los siguientes valores:

- family: NombreDeLaFuente
  source: google
  weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]

Fuentes disponibles en el sistema

Hay que asegurarse de cuáles son las fuentes que están instaladas en su sistema operativo para que Typst pueda acceder a ella. Puede ejecutar el comando typst fonts en la terminal para ver las fuentes disponibles en tu sistema.

quarto typst fonts

El listado podría ser algo así (dependerá de las fuentes que tengas instaladas en tu sistema):

Academy Engraved LET
ADT Slab Numeric
ADT Slab Soft Numeric
Al Bayan
Al Bayan PUA
Al Nile
Al Nile PUA
Al Tarikh
Al Tarikh PUA
American Typewriter
Andale Mono
Apple Braille
Apple Chancery
Apple Color Emoji
Apple Color Emoji UI
Apple SD Gothic Neo
Apple SD Gothic NeoI
Apple Symbols
AppleGothic
AppleMyungjo
Aqua Kana
Arial
Arial Hebrew
Arial Hebrew Desk Interface
Arial Hebrew Scholar
Arial Rounded MT
Arial Unicode MS
Athelas
Avenir
Avenir Book
Avenir Next
Ayuthaya
.....

O también el siguiente comando que mostraría las fuentes sin tener en cuenta las del sistema:

quarto typst fonts --ignore-system-fonts

Cualquier de las fuentes que aparecen en el listado se puede usar en el documento especificando su nombre en la sección fonts:. Por ejemplo, si tienes instalada la fuente “Calibri” en tu sistema, puedes usarla directamente al utilizarla en cualquier opción de fuente: base, headings (o mathfont en la sección defaults del formato typst que queramos usar, como el de la extensión memoriatfetypst-typst), etc. Por ejemplo, para usar “Calibri” como fuente base y como fuente para matemáticas, puedes hacerlo así:

brand: 
  typography:
    base: Calibri
defaults:
  memoriatfetypst-typst:
    mathfont: Calibri

O también así, previamente la incluiumos en la sección fonts::

brand: 
  typography:
    fonts: 
      - family: Calibri
        source: system
        weight: [100, 200, 300, 400, 500, 600, 700, 800, 900]
    base: Calibri
   

Fuentes desde archivos locales

También puedes usar fuentes almacenadas localmente en tu proyecto. Para ello, debes especificar la ruta a los archivos de fuente. Por ejemplo, para usar la fuente “Libertinus Serif” y “Libertinus Math” desde archivos locales, puedes hacerlo así:


      - family: Libertinus Serif
        source: file
        files:
          - path: static/fonts/Libertinus-7.051/static/OTF/LibertinusSerif-Regular.otf
          - path: static/fonts/Libertinus-7.051/static/OTF/LibertinusSerif-Italic.otf
            style: italic

PDFs de ejemplo con distintas fuentes