Ver Fonte

feat(chart): add Astronomicon font and glyph mapping

- Add Astronomicon.ttf (OFL licensed, ~90+ glyphs) to static/fonts/
- Add astronomicon-character-map.md reference doc
- Add chart_font.py with full glyph lookup:
  - Zodiac signs (A-L)
  - Planets (Q-Z, R for Moon)
  - Major/minor aspects (!, %, #, $, ", etc.)
  - Angles (c, d, e, f)
  - Houses (0-9, :, ;)
  - Asteroids, dwarf planets, Uranian points, lots
  - glyph() helper with aliases
- Prepared for chart rendering engine
Lukas Goldschmidt há 1 mês atrás
pai
commit
c8c5b6097c

+ 207 - 0
docs/astronomicon-character-map.md

@@ -0,0 +1,207 @@
+# Astronomicon Font — Character Map
+
+Free under the [Open Font License](https://scripts.sil.org/OFL).  
+Download: https://astronomicon.co/AstronomiconFonts_1.1.zip
+
+---
+
+## Zodiac Signs
+
+| Key | Symbol | Name |
+|-----|--------|------|
+| `A` | ♈ | Aries |
+| `B` | ♉ | Taurus |
+| `C` | ♊ | Gemini |
+| `D` | ♋ | Cancer |
+| `E` | ♌ | Leo |
+| `F` | ♍ | Virgo |
+| `G` | ♎ | Libra |
+| `H` | ♏ | Scorpio |
+| `I` | ♐ | Sagittarius |
+| `\` | ♑ | Capricorn (US) |
+| `J` | ♑ | Capricorn (EU) |
+| `K` | ♒ | Aquarius |
+| `L` | ♓ | Pisces |
+
+---
+
+## Planets
+
+| Key | Symbol | Name |
+|-----|--------|------|
+| `R` | ☽ | Moon |
+| `S` | ☿ | Mercury |
+| `T` | ♀ | Venus |
+| `Q` | ☉ | Sun |
+| `U` | ♂ | Mars |
+| `V` | ♃ | Jupiter |
+| `W` | ♄ | Saturn |
+| `X` | ♅ | Uranus |
+| `Y` | ♆ | Neptune |
+| `Z` | ♇ | Pluto |
+| `]` |   | Pluto (alternative 1) |
+| `_` |   | Pluto (alternative 2 — PL) |
+| `` ` `` |   | Pluto (alternative 3) |
+| `a` |   | Uranus (alternative) |
+| `b` |   | Vulcan |
+| `[` |   | Vulcan (Anthroposophy alternative) |
+
+---
+
+## Nodes, Earth & Lilith
+
+| Key | Symbol | Name |
+|-----|--------|------|
+| `g` | ☊ | Lunar North Node |
+| `h` | ⊕ | Earth (Antinomy) |
+| `i` | ☋ | Lunar South Node |
+| `>` |   | Earth (astronomy alternative) |
+| `z` |   | Lilith |
+
+---
+
+## Houses & Angles
+
+| Key | Name |
+|-----|------|
+| `0` | House 1 |
+| `1` | House 2 |
+| `2` | House 3 |
+| `3` | House 4 |
+| `4` | House 5 |
+| `5` | House 6 |
+| `6` | House 7 |
+| `7` | House 8 |
+| `8` | House 9 |
+| `9` | House 10 |
+| `:` | House 11 |
+| `;` | House 12 |
+| `<` | House 13 |
+| `c` | Ascendant (ASC) |
+| `d` | Midheaven (MC) |
+| `f` | Descendant (DSC) |
+| `e` | Imum Coeli (IC) |
+
+---
+
+## Major Aspects
+
+| Key | Degrees | Name |
+|-----|---------|------|
+| `!` | 0° | Conjunction |
+| `%` | 60° | Sextile |
+| `#` | 90° | Square |
+| `$` | 120° | Trine |
+| `"` | 180° | Opposition |
+
+---
+
+## Minor Aspects
+
+| Key | Degrees | Name |
+|-----|---------|------|
+| `&` | 150° | Quincunx (Inconjunct) |
+| `'` | 30° | Semi-sextile |
+| `(` | 45° | Semi-square |
+| `)` | 135° | Sesquisquare |
+| `*` | 144° | Biquintile |
+| `·` | 72° | Quintile |
+| `+` | 72° | Quintile (variant) |
+| `,` | 36° | Semi-quintile |
+| `¸` | 165° | Quindecile |
+
+---
+
+## Parallels & Extra Aspects
+
+| Key | Degrees | Name |
+|-----|---------|------|
+| `/` |   | Parallel |
+| `-` |   | Contra-parallel |
+| `ª` | 51.4° | Septile |
+| `«` | 102.8° | Bi-septile |
+| `¬` | 154.3° | Tri-septile |
+| `®` | 40° | Novile |
+| `¯` | 80° | Bi-novile |
+| `°` | 160° | Quatro-novile |
+
+---
+
+## Asteroids
+
+| Key | Symbol | Name |
+|-----|--------|------|
+| `l` | ⚳ | Ceres |
+| `m` | ⚴ | Pallas |
+| `n` | ⚵ | Juno |
+| `o` | ⚶ | Vesta |
+| `p` |   | Hygiea |
+| `q` | ⚷ | Chiron |
+| `r` |   | Pholus |
+
+---
+
+## Dwarf Planets
+
+| Key | Name |
+|-----|------|
+| `s` | Eris |
+| `t` | Haumea |
+| `u` | Makemake |
+| `v` | Gonggong |
+| `w` | Quaoar |
+| `x` | Sedna |
+| `y` | Orcus |
+
+---
+
+## Uranian Astrology
+
+| Key | Name |
+|-----|------|
+| `¡` | Cupido |
+| `¢` | Hades |
+| `£` | Zeus |
+| `¤` | Kronos |
+| `¥` | Apollon |
+| `¦` | Admetos |
+| `§` | Vulcanus |
+| `¨` | Poseidon |
+
+---
+
+## Lots & Chart Points
+
+| Key | Name |
+|-----|------|
+| `?` | Part of Fortune |
+| `@` | Part of Spirit |
+| `j` | East Point |
+| `k` | Vertex |
+
+---
+
+## Chart Notation (subscripts)
+
+| Key | Name |
+|-----|------|
+| `M` | Radix / Retrograde |
+| `N` | Retrograde |
+| `O` | Transiting |
+| `P` | Progressed |
+
+---
+
+## Spiritual Alchemy
+
+| Key | Symbol | Name |
+|-----|--------|------|
+| `µ` |   | Pentagram |
+| `\|` |   | Sulphur |
+| `S` | ☿ | Mercury (see Planets) |
+| `}` |   | Salt |
+| `¶` |   | Hexagram |
+| `±` | 🜂 | Fire |
+| `²` | 🜁 | Air |
+| `³` | 🜄 | Water |
+| `´` | 🜃 | Earth |

+ 193 - 0
src/astro_mcp/chart_font.py

@@ -0,0 +1,193 @@
+"""
+Astronomicon font glyph mapping.
+
+Maps astrological entity names to their corresponding ASCII key characters
+in the Astronomicon font (https://astronomicon.co, OFL licensed).
+
+Usage:
+    from astro_mcp.chart_font import ASTRONOMICON
+
+    char = ASTRONOMICON["sun"]        # 'Q'
+    char = ASTRONOMICON["aries"]      # 'A'
+    char = ASTRONOMICON["conjunction"] # '!'
+"""
+
+# ── Zodiac Signs ──────────────────────────────────────────────────────
+ZODIAC = {
+    "aries":       "A",
+    "taurus":      "B",
+    "gemini":      "C",
+    "cancer":      "D",
+    "leo":         "E",
+    "virgo":       "F",
+    "libra":       "G",
+    "scorpio":     "H",
+    "sagittarius": "I",
+    "capricorn":   "J",   # EU style; US style is backslash
+    "aquarius":    "K",
+    "pisces":      "L",
+}
+
+# ── Planets ───────────────────────────────────────────────────────────
+PLANETS = {
+    "moon":       "R",
+    "mercury":    "S",
+    "venus":      "T",
+    "sun":        "Q",
+    "mars":       "U",
+    "jupiter":    "V",
+    "saturn":     "W",
+    "uranus":     "X",
+    "neptune":    "Y",
+    "pluto":      "Z",
+}
+
+# ── Nodes, Earth & Lilith ─────────────────────────────────────────────
+NODES = {
+    "north_node": "g",
+    "south_node": "i",
+    "earth":      "h",
+    "lilith":     "z",
+}
+
+# ── Houses & Angles ───────────────────────────────────────────────────
+# Houses 1-12 use digits 0-9 and : ;
+# House 1 = '0', House 2 = '1', ..., House 10 = '9', House 11 = ':', House 12 = ';'
+HOUSES = {str(i): str(i - 1) for i in range(1, 10)}  # 1-9 → '0'-'8'
+HOUSES["10"] = "9"
+HOUSES["11"] = ":"
+HOUSES["12"] = ";"
+
+ANGLES = {
+    "ascendant":  "c",
+    "midheaven":  "d",
+    "descendant": "f",
+    "imum_coeli": "e",
+    "asc":        "c",
+    "mc":         "d",
+    "dsc":        "f",
+    "ic":         "e",
+}
+
+# ── Major Aspects ─────────────────────────────────────────────────────
+MAJOR_ASPECTS = {
+    "conjunction": "!",
+    "sextile":     "%",
+    "square":      "#",
+    "trine":       "$",
+    "opposition":  '"',
+}
+
+# ── Minor Aspects ─────────────────────────────────────────────────────
+MINOR_ASPECTS = {
+    "quincunx":      "&",
+    "semi_sextile":  "'",
+    "semi_square":   "(",
+    "sesquisquare":  ")",
+    "biquintile":    "*",
+    "quintile":      "+",
+    "semi_quintile": ",",
+}
+
+# ── Parallels ─────────────────────────────────────────────────────────
+PARALLELS = {
+    "parallel":        "/",
+    "contra_parallel": "-",
+}
+
+# ── Asteroids ─────────────────────────────────────────────────────────
+ASTEROIDS = {
+    "ceres":   "l",
+    "pallas":  "m",
+    "juno":    "n",
+    "vesta":   "o",
+    "hygiea":  "p",
+    "chiron":  "q",
+    "pholus":  "r",
+}
+
+# ── Dwarf Planets ─────────────────────────────────────────────────────
+DWARF_PLANETS = {
+    "eris":     "s",
+    "haumea":   "t",
+    "makemake": "u",
+    "gonggong": "v",
+    "quaoar":   "w",
+    "sedna":    "x",
+    "orcus":    "y",
+}
+
+# ── Uranian Points ────────────────────────────────────────────────────
+URANIAN = {
+    "cupido":    "¡",
+    "hades":     "¢",
+    "zeus":      "£",
+    "kronos":    "¤",
+    "apollon":   "¥",
+    "admetos":   "¦",
+    "vulcanus":  "§",
+    "poseidon":  "¨",
+}
+
+# ── Lots & Chart Points ───────────────────────────────────────────────
+LOTS = {
+    "part_of_fortune": "?",
+    "part_of_spirit":  "@",
+    "east_point":      "j",
+    "vertex":          "k",
+}
+
+# ── Retrograde marker ─────────────────────────────────────────────────
+RETROGRADE = "N"  # Astronomicon uses 'N' for retrograde subscript
+
+# ── Combined lookup ──────────────────────────────────────────────────
+# Flat dict for simple name → char lookups
+ALL = {}
+ALL.update(ZODIAC)
+ALL.update(PLANETS)
+ALL.update(NODES)
+ALL.update(ANGLES)
+ALL.update(MAJOR_ASPECTS)
+ALL.update(MINOR_ASPECTS)
+ALL.update(PARALLELS)
+ALL.update(ASTEROIDS)
+ALL.update(DWARF_PLANETS)
+ALL.update(URANIAN)
+ALL.update(LOTS)
+
+
+def glyph(name: str) -> str:
+    """Return the Astronomicon font character for an astrological entity name.
+
+    Args:
+        name: Entity name, e.g. "sun", "aries", "conjunction", "ascendant"
+
+    Returns:
+        Single ASCII character that renders as the correct glyph in Astronomicon font.
+
+    Raises:
+        KeyError: If name is not found in any mapping.
+    """
+    key = name.lower().strip()
+    if key in ALL:
+        return ALL[key]
+    # Try common aliases
+    aliases = {
+        "northnode": "north_node",
+        "southnode": "south_node",
+        "true_node": "north_node",
+        "asc": "ascendant",
+        "mc": "midheaven",
+        "dsc": "descendant",
+        "ic": "imum_coeli",
+        "pof": "part_of_fortune",
+        "pos": "part_of_spirit",
+        "inconjunct": "quincunx",
+        "semisextile": "semi_sextile",
+        "semisquare": "semi_square",
+        "sesquiquadrate": "sesquisquare",
+        "biquintile": "biquintile",
+    }
+    if key in aliases:
+        return ALL[aliases[key]]
+    raise KeyError(f"Unknown astrological entity: {name!r}")

BIN
static/fonts/Astronomicon.ttf