{
  "id": "python/matplotlib-pdf-font-embedding-error",
  "signature": "RuntimeError: Failed to process string with tex because of missing font metrics.",
  "signature_zh": "RuntimeError: 由于缺少字体度量，无法使用tex处理字符串。",
  "regex": "RuntimeError:\\ Failed\\ to\\ process\\ string\\ with\\ tex\\ because\\ of\\ missing\\ font\\ metrics\\.",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "Using LaTeX text rendering (usetex=True) without a complete LaTeX installation or missing required fonts.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用LaTeX文本渲染(usetex=True)时，LaTeX安装不完整或缺少所需字体。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Installing only matplotlib with pip",
      "why_fails": "LaTeX is a separate system; pip cannot install it.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting usetex=False but still getting error",
      "why_fails": "If usetex is False, this error should not occur; the setting might not have been reset.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install a full LaTeX distribution (e.g., TeX Live or MiKTeX)",
      "success_rate": 0.9,
      "how": "sudo apt-get install texlive-latex-base texlive-fonts-recommended",
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable usetex and use Matplotlib's built-in math rendering",
      "success_rate": 0.95,
      "how": "plt.rcParams['text.usetex'] = False",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}