Word renders hyperlinks as bold in Arabic documents even though no `` exists in document or styles (OpenXML)

Issue Analysis: Arabic Hyperlinks Render Bold in Word Despite Missing OpenXML Bold Tag

Summary

  • Run properties
  • Character styles (“Hyperlink”)
  • Base styles (“DefaultParagraphFont”)
  • Paragraph styles
    The system failed to reconstruct the bold rendering during document regeneration.

Root Cause

The bold appearance originates from Word’s locale-specific defaults for complex scripts:
2. Word internally applies bold formatting to hyperlinks for Arabic text
3. These implicit rules aren’t serialized in OpenXML markup
4. The reconstruction pipeline treated styles strictly through explicit XML tags

Why This Happens in Real Systems

  • Microsoft Word modifies rendering based on document language settings
  • Complex scripts (Arabic, Hebrew, etc.) have distinct typography rules
  • Default Styling Overrides:
    • Application-level rules augment explicit styles
    • Priority: Locale defaults > Theme styles > Document styles > Direct formatting
  • Hidden Theme Settings:
  • Word doesn’t serialize locale-specific styling in OpenXML

Real-World Impact

  • Conversion pipelines lose Arabic document fidelity
  • Legal/government documents show inconsistent section references
  • Arabic users perceive broken hyperlink styling
  • Compliance risks when digital documents don’t match originals
  • Reconstruction workflows fail QA in multilingual offices

How Senior Engineers Fix It

  1. Detect Locale Context

    During conversion of Arabic Word documents to Akoma Ntoso XML and back, hyperlinks appeared bold in Word despite no bold declarations (``) existing in:
  2. Arabic (RTL) documents trigger special typographic defaults
    Office themes contain unpublished rules for internationalization
    Inspect document language properties:

    xml
     
                   
  3. Apply Conditional Formatting

    When reconstructing Arabic hyperlinks:

    csharp
    if (isArabicHyperlink)
    {
    hyperlinkRun.Properties.Bold = new Bold(); // Add explicit w:b
    }

  4. Replicate Word Theme Defaults

  5. Extract Hidden Properties

    Maintain lookup tables of locale-specific rules:
    | Locale   | Hyperlink Formatting |
    |----------|-----------------------|
    | ar-*     | Bold + Blue + Underline |
    | en-US    | Blue + Underline     |
    Check document-level compatibility flags:

    xml



  6. Override Default Styles

    Explicitly define Arabic hyperlink style to override theme:

    xml







Why Juniors Miss It

  1. Over-reliance on explicit XML markup
  2. Unawareness of locale-specific rendering rules
  3. Testing primarily with Latin-character documents
  4. Assuming OpenXML reflects all visual properties
  5. Missing Word’s implicit internationalization rules
  6. Oversimplifying hyperlink styling inheritance