# EXACT Current Fonts Used in Report Generation

## 🎯 Current Font Stack (As Generated)

### CSS Classes with Explicit Font Declarations
Located in: `/var/www/html/wnapi/pdf-files-app/pdf_footer.php` (Lines 14-56)

```css
.header_start {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.header_text {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.subheader_start {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.subheader_text {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.pdf_chapter {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.summary_start {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.summary {
  font-family: Century Gothic;  ❌ NOT AVAILABLE → Falls back to default
}

.pdf_chapter_reportname {
  font-family: "Profile Pro", sans-serif;  ❌ Profile Pro NOT AVAILABLE → Uses sans-serif
}
```

### Page Numbers & Headers
Located in: `/var/www/html/wnapi/pdf-files-app/pdf_footer.php` (Line 508)

```php
$canvas->page_script('
  $font = $fontMetrics->get_font("Century Gothic", "bold");  ❌ NOT AVAILABLE
  // Falls back to: Helvetica (default PDF font)
');
```

### Cover Page (Optional)
Located in: `/var/www/html/wnapi/pdf-files-app/pdf_header.php`

```php
font-family: 'Gotham', sans-serif;        ✅ FOUND → Uses GothamBook.ttf
font-family: kabelM;                      ❌ NOT AVAILABLE → Falls back to sans-serif
font-family: 'Figtree Medium', 'Futura', 'GothamCondensed-Medium', sans-serif;
           ❌ Figtree         ❌ Futura  ✅ GothamCondensed-Medium FOUND
```

### Text-to-Image (Cover Names)
Located in: `/var/www/html/wnapi/pdf-files-app/text-image.php` (Line 10)

```php
$font = dirname(__DIR__) . '/dompdf/lib/fonts/GothamCondensed-Medium.otf';  ✅ FOUND
```

---

## 📊 Actual Rendering Result

### What SHOULD Render vs What ACTUALLY Renders

| Element | Requested Font | File Status | Actual Rendered Font | Type |
|---------|-----------------|-------------|----------------------|------|
| **Headers** | Century Gothic | ❌ MISSING | Helvetica (default) | Wrong |
| **Body Text** | Century Gothic | ❌ MISSING | Helvetica (default) | Wrong |
| **Section Titles** | Century Gothic | ❌ MISSING | Helvetica (default) | Wrong |
| **Report Names** | Profile Pro | ❌ MISSING | Sans-serif (generic) | Wrong |
| **Page Numbers** | Century Gothic | ❌ MISSING | Helvetica (default) | Wrong |
| **Cover Names** | GothamCondensed-Medium | ✅ PRESENT | GothamCondensed-Medium | Correct |
| **Cover Info** | Gotham | ✅ PRESENT | GothamBook.ttf | Correct |
| **Fallback Text** | (unspecified) | N/A | DejaVuSans (default) | Acceptable |

---

## 🔧 Dompdf Configuration (Current)

File: `/var/www/html/wnapi/pdf-files-app/pdf_footer.php` (Lines 10-13)

### Current Configuration:
```php
$dompdf = new DOMPDF(array(
    'enable_remote' => true,      // ✅ Remote resources enabled
    'isPhpEnabled' => true,       // ✅ PHP processing enabled
    'isHtml5Parser' => true       // ✅ HTML5 parser enabled
    // ❌ NO fontDir specified
    // ❌ NO defaultFont specified
    // ❌ NO isFontSubsettingEnabled specified
));
```

### Result:
- **Default Font**: Helvetica (PDF standard)
- **Font Subsetting**: OFF (larger file sizes)
- **Font Directory**: dompdf internal default

---

## 💾 Font Files Actually Available

File: `/var/www/html/wnapi/dompdf/lib/fonts/`

### ✅ PRESENT & USED
```
GothamBook.ttf                    56.6 KB  → Renders as "Gotham"
GothamLight.ttf                   56.5 KB  → Available but not used
GothamCondensed-Medium.otf        28.6 KB  → Used in text-to-image
GothamBookRegular.otf             29.5 KB  → Available but not used
GothamCondensed-Bold.otf          28.5 KB  → Available but not used
GothamCondensed-Light.otf         28.5 KB  → Available but not used
GothamCondensed-Book.otf          28.5 KB  → Available but not used
```

### ✅ PRESENT FOR FALLBACK
```
DejaVuSans.ttf                   757 KB   → Used when fonts missing
DejaVuSans-Bold.ttf              705 KB   → Used for bold fallback
DejaVuSans-Oblique.ttf           635 KB   → Used for italic fallback
DejaVuSans-BoldOblique.ttf       643 KB   → Used for bold italic fallback
DejaVuSerif.ttf                  380 KB   → Available for fallback
DejaVuSansMono.ttf               340 KB   → Available for fallback
```

### ✅ PRESENT (PDF Standards)
```
Helvetica (native)                        → Default fallback
Courier (native)                          → Available
Times-Roman (native)                      → Available
```

### ❌ MISSING (But Referenced)
```
Century Gothic                    ❌ NOT IN DIRECTORY
kabelM                           ❌ NOT IN DIRECTORY
Profile Pro                      ❌ NOT IN DIRECTORY
Futura                           ❌ NOT IN DIRECTORY (CSS fallback only)
Figtree Medium                   ❌ NOT IN DIRECTORY (CSS fallback only)
```

---

## 🔍 Font Resolution Flow (Current)

```
REPORT GENERATION STARTS
    ↓
PDF classes loaded from pdf_footer.php (lines 14-56)
    ├─ .header_start → font-family: Century Gothic
    ├─ .summary → font-family: Century Gothic
    ├─ .pdf_chapter → font-family: Century Gothic
    └─ .pdf_chapter_reportname → font-family: "Profile Pro", sans-serif
    ↓
dompdf loads HTML with CSS
    ↓
dompdf processes each font-family declaration
    ├─ Checks: Is "Century Gothic" registered? → NO ❌
    ├─ Checks: Does file exist in fonts dir? → NO ❌
    ├─ Checks: CSS fallback chain? → NO FALLBACK ❌
    ├─ Result: Uses defaultFont → Helvetica (PDF native)
    │
    └─ Checks: Is "Profile Pro" available? → NO ❌
       Checks: Is "sans-serif" available? → Resolves to → DejaVuSans ✅
    ↓
PDF renders with Helvetica/DejaVuSans (wrong fonts)
    ↓
Output: PDF with generic sans-serif (not the professional Century Gothic)
```

---

## 📈 Current Usage Statistics

### By Report Type:
All report types use the SAME font configuration from `pdf_footer.php`:

| Report Type | Font Used | Status |
|------------|-----------|--------|
| Personality Profile | Century Gothic | ❌ Wrong (renders as Helvetica) |
| Relationship Compatibility | Century Gothic | ❌ Wrong (renders as Helvetica) |
| Forecast (Yearly) | Century Gothic | ❌ Wrong (renders as Helvetica) |
| Forecast (Monthly) | Century Gothic | ❌ Wrong (renders as Helvetica) |
| Name Advisor | Century Gothic | ❌ Wrong (renders as Helvetica) |
| Talent Profile | Century Gothic | ❌ Wrong (renders as Helvetica) |
| Cover Pages | Gotham + kabelM | ⚠️ Partial (Gotham OK, kabelM wrong) |

---

## 📊 Font Usage Breakdown

### WHERE EACH FONT IS APPLIED:

#### Century Gothic (7+ CSS classes)
```
Location: pdf_footer.php, lines 15-56
Usage:
  - All section headers (.header_start, .header_text)
  - All subheaders (.subheader_start, .subheader_text)
  - All chapter titles (.pdf_chapter)
  - All body text summaries (.summary_start, .summary)
Impact: ENTIRE REPORT affected
```

#### Profile Pro (1 CSS class)
```
Location: pdf_footer.php, line 157
Usage:
  - Report titles (.pdf_chapter_reportname)
  - Client names on cover
Impact: COVER PAGE title styling affected
```

#### Gotham / GothamBook (Cover info)
```
Location: pdf_header.php (multiple inline styles)
Usage:
  - Business info on custom cover
  - Fallback in font chain
Impact: CUSTOM COVER PAGES only
```

#### Page Numbers
```
Location: pdf_footer.php, line 508
Request: Century Gothic (bold)
Result: Falls back to Helvetica (PDF default)
Impact: Page numbers at bottom of every page
```

---

## 🎯 Summary: EXACT Current State

### ✅ WORKING CORRECTLY:
- GothamCondensed-Medium.otf (text-to-image rendering)
- GothamBook.ttf (cover page styling)
- Fallback fonts (DejaVuSans for unspecified text)

### ❌ BROKEN/WRONG:
- Century Gothic (requested, not available, falls to Helvetica)
- Profile Pro (requested, not available, falls to generic sans-serif)
- kabelM (requested, not available, falls to generic sans-serif)

### ⚠️ PARTIALLY WORKING:
- Futura & Figtree Medium (in CSS fallback chain but not present, then fall through chain)

### 📊 Impact:
- **Headers**: Wrong font (generic Helvetica instead of professional Century Gothic)
- **Body**: Wrong font (generic Helvetica instead of professional Century Gothic)
- **Titles**: Wrong font (generic sans-serif instead of Profile Pro)
- **Overall**: Reports render as plain/generic instead of professional/branded

---

**Current Date**: January 27, 2026  
**Status**: Reports generate successfully but with WRONG FONTS  
**Fix Effort**: Quick CSS changes (5 min) OR full font procurement (varies)
