﻿================================================================================
  FONT EXTRACTION API VALIDATION
  Server: http://localhost:8000
  Corpus: C:\Users\Maskan\Desktop\pdf_editor\pdf\corpus\fonts
  Timestamp: 2026-06-02 12:36:47
================================================================================

  Server status: OK (200)
  PDFs to validate: ['utf-8.pdf', 'vertical_text.pdf', 'subset_font.pdf']

================================================================================
  VALIDATING: utf-8.pdf
================================================================================


--- Step 1: Upload utf-8.pdf ---

  Status: 201
  Response: {
  "id": "6764e35e-3594-4b50-a378-3ea122a54d9d",
  "filename": "utf-8.pdf",
  "sizeBytes": 1275,
  "totalPages": 1,
  "uploadedAt": "2026-06-02T07:06:50.429369Z",
  "status": "ready"
}
  Document ID: 6764e35e-3594-4b50-a378-3ea122a54d9d

--- Step 2: Document Font Extraction ---

  Status: 200
  Font count: 2

  Font #0:
    {
    "fontName": "Helvetica",
    "type": "Type1",
    "isEmbedded": false,
    "isSubset": false,
    "isVertical": false,
    "encoding": "WinAnsiEncoding",
    "hasToUnicode": true,
    "cmapName": "None",
    "cidSystemInfo": "None",
    "subsetTag": "",
    "sourceType": "SystemFallback",
    "substitutedFrom": "",
    "substitutedTo": "",
    "normalizedFamily": "Helvetica",
    "internalFontId": "Helvetica_Type1_32",
    "flags": 32,
    "ascent": 905.0,
    "descent": -211.0,
    "capHeight": 728.0
}

  Font #1:
    {
    "fontName": "Times-Roman",
    "type": "Type1",
    "isEmbedded": false,
    "isSubset": false,
    "isVertical": false,
    "encoding": "WinAnsiEncoding",
    "hasToUnicode": true,
    "cmapName": "None",
    "cidSystemInfo": "None",
    "subsetTag": "",
    "sourceType": "SystemFallback",
    "substitutedFrom": "",
    "substitutedTo": "",
    "normalizedFamily": "Times",
    "internalFontId": "Times-Roman_Type1_32",
    "flags": 32,
    "ascent": 891.0,
    "descent": -216.0,
    "capHeight": 662.0
}

--- Step 3: Page Font Extraction (page 0) ---

  Status: 200
  Page font count: 2

  Page Font #0:
    {
    "fontName": "Helvetica",
    "type": "Type1",
    "isEmbedded": false,
    "isSubset": false,
    "isVertical": false,
    "encoding": "WinAnsiEncoding",
    "hasToUnicode": true,
    "cmapName": "None",
    "cidSystemInfo": "None",
    "subsetTag": "",
    "sourceType": "SystemFallback",
    "substitutedFrom": "",
    "substitutedTo": "",
    "normalizedFamily": "Helvetica",
    "internalFontId": "Helvetica_Type1_32",
    "flags": 32,
    "ascent": 905.0,
    "descent": -211.0,
    "capHeight": 728.0
}

  Page Font #1:
    {
    "fontName": "Times-Roman",
    "type": "Type1",
    "isEmbedded": false,
    "isSubset": false,
    "isVertical": false,
    "encoding": "WinAnsiEncoding",
    "hasToUnicode": true,
    "cmapName": "None",
    "cidSystemInfo": "None",
    "subsetTag": "",
    "sourceType": "SystemFallback",
    "substitutedFrom": "",
    "substitutedTo": "",
    "normalizedFamily": "Times",
    "internalFontId": "Times-Roman_Type1_32",
    "flags": 32,
    "ascent": 891.0,
    "descent": -216.0,
    "capHeight": 662.0
}

  Document font names: ['Helvetica', 'Times-Roman']
  Page font names:     ['Helvetica', 'Times-Roman']
  [OK] Page fonts are a subset of document fonts

--- Step 4: Text Extraction (page 0) ---

  Status: 200
  Extracted text: 'Hello World - UTF-8 Test Document\r\nStandard Latin Text for Encoding Verification\r\nFont Size Detection Sample: Small Text 12pt\r\nLARGE TEXT FOR SIZE 18PT DETECTION\r\nMore 18pt content: ABCDEFGHabcdefgh 0123456789\r\nBack to 12pt: The quick brown fox jumps over the lazy dog\r\nSpecial chars: copyright secti'
  Glyph count: 312

  First 5 glyphs (sample):
    Glyph #0: {
      "text": "H",
      "x": 72.95999908447266,
      "y": 720.0,
      "w": 6.7440032958984375,
      "h": 8.59197998046875,
      "fontSize": 12.0
}
    Glyph #1: {
      "text": "e",
      "x": 81.10800170898438,
      "y": 719.8679809570312,
      "w": 5.736000061035156,
      "h": 6.49200439453125,
      "fontSize": 12.0
}
    Glyph #2: {
      "text": "l",
      "x": 88.10400390625,
      "y": 720.0,
      "w": 1.055999755859375,
      "h": 8.59197998046875,
      "fontSize": 12.0
}
    Glyph #3: {
      "text": "l",
      "x": 90.76799774169922,
      "y": 720.0,
      "w": 1.055999755859375,
      "h": 8.59197998046875,
      "fontSize": 12.0
}
    Glyph #4: {
      "text": "o",
      "x": 93.05999755859375,
      "y": 719.8679809570312,
      "w": 5.832000732421875,
      "h": 6.49200439453125,
      "fontSize": 12.0
}

  Font sizes detected: [1.0, 12.0, 18.0]

--- Step 5: Content-Specific Validation ---

  UTF-8 PDF - extracted text: 'Hello World - UTF-8 Test Document\r\nStandard Latin Text for Encoding Verification\r\nFont Size Detection Sample: Small Text 12pt\r\nLARGE TEXT FOR SIZE 18PT DETECTION\r\nMore 18pt content: ABCDEFGHabcdefgh 0123456789\r\nBack to 12pt: The quick brown fox jumps over the lazy dog\r\nSpecial chars: copyright secti'
  [INFO] No non-ASCII characters detected - content may be ASCII-only

================================================================================
  VALIDATING: vertical_text.pdf
================================================================================


--- Step 1: Upload vertical_text.pdf ---

  Status: 201
  Response: {
  "id": "d28fd4e4-a059-4a9b-bf15-b6cf25caf280",
  "filename": "vertical_text.pdf",
  "sizeBytes": 3518,
  "totalPages": 1,
  "uploadedAt": "2026-06-02T07:06:50.465835Z",
  "status": "ready"
}
  Document ID: d28fd4e4-a059-4a9b-bf15-b6cf25caf280

--- Step 2: Document Font Extraction ---

  Status: 200
  Font count: 1

  Font #0:
    {
    "fontName": "Test",
    "type": "TrueType",
    "isEmbedded": false,
    "isSubset": false,
    "isVertical": true,
    "encoding": "Identity-V",
    "hasToUnicode": true,
    "cmapName": "Identity-V",
    "cidSystemInfo": "None",
    "subsetTag": "",
    "sourceType": "Substituted",
    "substitutedFrom": "Test",
    "substitutedTo": "Arial",
    "normalizedFamily": "Test",
    "internalFontId": "Test_TrueType_524320",
    "flags": 524320,
    "ascent": 905.0,
    "descent": -211.0,
    "capHeight": 728.0
}

--- Step 3: Page Font Extraction (page 0) ---

  Status: 200
  Page font count: 1

  Page Font #0:
    {
    "fontName": "Test",
    "type": "TrueType",
    "isEmbedded": false,
    "isSubset": false,
    "isVertical": true,
    "encoding": "Identity-V",
    "hasToUnicode": true,
    "cmapName": "Identity-V",
    "cidSystemInfo": "None",
    "subsetTag": "",
    "sourceType": "Substituted",
    "substitutedFrom": "Test",
    "substitutedTo": "Arial",
    "normalizedFamily": "Test",
    "internalFontId": "Test_TrueType_524320",
    "flags": 524320,
    "ascent": 905.0,
    "descent": -211.0,
    "capHeight": 728.0
}

  Document font names: ['Test']
  Page font names:     ['Test']
  [OK] Page fonts are a subset of document fonts

--- Step 4: Text Extraction (page 0) ---

  Status: 200
  Extracted text: 'Hello World!\r\nHello'
  Glyph count: 19

  First 5 glyphs (sample):
    Glyph #0: {
      "text": "H",
      "x": 6.832000255584717,
      "y": 180.1840057373047,
      "w": 6.552000522613525,
      "h": 8.699996948242188,
      "fontSize": 12.0
}
    Glyph #1: {
      "text": "e",
      "x": 7.324000358581543,
      "y": 171.39999389648438,
      "w": 5.495999336242676,
      "h": 6.756011962890625,
      "fontSize": 12.0
}
    Glyph #2: {
      "text": "l",
      "x": 9.687999725341797,
      "y": 160.49200439453125,
      "w": 1.055999755859375,
      "h": 9.251998901367188,
      "fontSize": 12.0
}
    Glyph #3: {
      "text": "l",
      "x": 9.687999725341797,
      "y": 149.4759979248047,
      "w": 1.055999755859375,
      "h": 9.251998901367188,
      "fontSize": 12.0
}
    Glyph #4: {
      "text": "o",
      "x": 7.324000358581543,
      "y": 140.69200134277344,
      "w": 5.951999664306641,
      "h": 6.7559967041015625,
      "fontSize": 12.0
}

  Font sizes detected: [1.0, 12.0]

--- Step 5: Content-Specific Validation ---

  Vertical text PDF - fonts with isVertical=true: 1
    - Test (isVertical=true)
  [OK] Vertical fonts detected correctly

================================================================================
  VALIDATING: subset_font.pdf
================================================================================


--- Step 1: Upload subset_font.pdf ---

  Status: 201
  Response: {
  "id": "cf3f2218-6ee7-4e34-973d-6e1b61c13cf8",
  "filename": "subset_font.pdf",
  "sizeBytes": 646,
  "totalPages": 1,
  "uploadedAt": "2026-06-02T07:06:50.497336Z",
  "status": "ready"
}
  Document ID: cf3f2218-6ee7-4e34-973d-6e1b61c13cf8

--- Step 2: Document Font Extraction ---

  Status: 200
  Font count: 1

  Font #0:
    {
    "fontName": "ABCDEF+Arial",
    "type": "TrueType",
    "isEmbedded": true,
    "isSubset": true,
    "isVertical": false,
    "encoding": "WinAnsiEncoding",
    "hasToUnicode": true,
    "cmapName": "None",
    "cidSystemInfo": "None",
    "subsetTag": "ABCDEF",
    "sourceType": "Embedded",
    "substitutedFrom": "",
    "substitutedTo": "",
    "normalizedFamily": "Arial",
    "internalFontId": "ABCDEF_ABCDEF+Arial",
    "flags": 0,
    "ascent": 905.0,
    "descent": -211.0,
    "capHeight": 728.0
}

--- Step 3: Page Font Extraction (page 0) ---

  Status: 200
  Page font count: 1

  Page Font #0:
    {
    "fontName": "ABCDEF+Arial",
    "type": "TrueType",
    "isEmbedded": true,
    "isSubset": true,
    "isVertical": false,
    "encoding": "WinAnsiEncoding",
    "hasToUnicode": true,
    "cmapName": "None",
    "cidSystemInfo": "None",
    "subsetTag": "ABCDEF",
    "sourceType": "Embedded",
    "substitutedFrom": "",
    "substitutedTo": "",
    "normalizedFamily": "Arial",
    "internalFontId": "ABCDEF_ABCDEF+Arial",
    "flags": 0,
    "ascent": 905.0,
    "descent": -211.0,
    "capHeight": 728.0
}

  Document font names: ['ABCDEF+Arial']
  Page font names:     ['ABCDEF+Arial']
  [OK] Page fonts are a subset of document fonts

--- Step 4: Text Extraction (page 0) ---

  Status: 200
  Extracted text: 'Subset Text'
  Glyph count: 11

  First 5 glyphs (sample):
    Glyph #0: {
      "text": "S",
      "x": 72.54000091552734,
      "y": 719.8679809570312,
      "w": 6.839996337890625,
      "h": 8.8680419921875,
      "fontSize": 12.0
}
    Glyph #1: {
      "text": "u",
      "x": 80.77200317382812,
      "y": 719.8679809570312,
      "w": 5.0399932861328125,
      "h": 6.36004638671875,
      "fontSize": 12.0
}
    Glyph #2: {
      "text": "b",
      "x": 87.45600128173828,
      "y": 719.8679809570312,
      "w": 5.400001525878906,
      "h": 8.7239990234375,
      "fontSize": 12.0
}
    Glyph #3: {
      "text": "s",
      "x": 93.72000122070312,
      "y": 719.8679809570312,
      "w": 5.159996032714844,
      "h": 6.49200439453125,
      "fontSize": 12.0
}
    Glyph #4: {
      "text": "e",
      "x": 99.79199981689453,
      "y": 719.8679809570312,
      "w": 5.736000061035156,
      "h": 6.49200439453125,
      "fontSize": 12.0
}

  Font sizes detected: [12.0]

--- Step 5: Content-Specific Validation ---

  Subset font PDF - fonts with isSubset=true: 1
    - ABCDEF+Arial (isSubset=true, subsetTag='ABCDEF')
  [OK] Subset fonts detected correctly

================================================================================
  FINAL REPORT
================================================================================


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  PDF: utf-8.pdf
  Document ID: 6764e35e-3594-4b50-a378-3ea122a54d9d
  Upload Status: 201
  Document Font Count: 2
  Page Font Count: 2
  Glyph Count: 312
  Font Sizes: [1.0, 12.0, 18.0]
  Issues: 6
    >> Glyph #0: missing coordinate 'right'
    >> Glyph #0: missing coordinate 'bottom'
    >> Glyph #1: missing coordinate 'right'
    >> Glyph #1: missing coordinate 'bottom'
    >> Glyph #2: missing coordinate 'right'
    >> Glyph #2: missing coordinate 'bottom'
  Errors: 0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  PDF: vertical_text.pdf
  Document ID: d28fd4e4-a059-4a9b-bf15-b6cf25caf280
  Upload Status: 201
  Document Font Count: 1
  Page Font Count: 1
  Glyph Count: 19
  Font Sizes: [1.0, 12.0]
  Issues: 6
    >> Glyph #0: missing coordinate 'right'
    >> Glyph #0: missing coordinate 'bottom'
    >> Glyph #1: missing coordinate 'right'
    >> Glyph #1: missing coordinate 'bottom'
    >> Glyph #2: missing coordinate 'right'
    >> Glyph #2: missing coordinate 'bottom'
  Errors: 0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  PDF: subset_font.pdf
  Document ID: cf3f2218-6ee7-4e34-973d-6e1b61c13cf8
  Upload Status: 201
  Document Font Count: 1
  Page Font Count: 1
  Glyph Count: 11
  Font Sizes: [12.0]
  Issues: 6
    >> Glyph #0: missing coordinate 'right'
    >> Glyph #0: missing coordinate 'bottom'
    >> Glyph #1: missing coordinate 'right'
    >> Glyph #1: missing coordinate 'bottom'
    >> Glyph #2: missing coordinate 'right'
    >> Glyph #2: missing coordinate 'bottom'
  Errors: 0

================================================================================
  SUMMARY ANSWERS
================================================================================

  1. Are fonts being extracted correctly?
     YES - 4 total fonts across 3 PDFs

  2. Are page fonts and document fonts consistent?
     YES

  3. Are font sizes being extracted correctly?
     YES

  4. Are vertical/subset fonts detected correctly?
     Vertical: YES
     Subset: YES

  5. Are there any metadata inaccuracies?
     YES - 18 issues and 0 errors found
       - [utf-8.pdf] Glyph #0: missing coordinate 'right'
       - [utf-8.pdf] Glyph #0: missing coordinate 'bottom'
       - [utf-8.pdf] Glyph #1: missing coordinate 'right'
       - [utf-8.pdf] Glyph #1: missing coordinate 'bottom'
       - [utf-8.pdf] Glyph #2: missing coordinate 'right'
       - [utf-8.pdf] Glyph #2: missing coordinate 'bottom'
       - [vertical_text.pdf] Glyph #0: missing coordinate 'right'
       - [vertical_text.pdf] Glyph #0: missing coordinate 'bottom'
       - [vertical_text.pdf] Glyph #1: missing coordinate 'right'
       - [vertical_text.pdf] Glyph #1: missing coordinate 'bottom'
       - [vertical_text.pdf] Glyph #2: missing coordinate 'right'
       - [vertical_text.pdf] Glyph #2: missing coordinate 'bottom'
       - [subset_font.pdf] Glyph #0: missing coordinate 'right'
       - [subset_font.pdf] Glyph #0: missing coordinate 'bottom'
       - [subset_font.pdf] Glyph #1: missing coordinate 'right'
       - [subset_font.pdf] Glyph #1: missing coordinate 'bottom'
       - [subset_font.pdf] Glyph #2: missing coordinate 'right'
       - [subset_font.pdf] Glyph #2: missing coordinate 'bottom'

================================================================================
  VALIDATION COMPLETE: 18 issues, 0 errors
================================================================================
