Font Family Improvements - Summary

🎯 What Was Changed

Your GitHub Pages site previously used an inconsistent mix of fonts:

✅ New Font Configuration

All fonts now use a modern, unified system font stack that:

📊 Before & After Comparison

Body Font

/* BEFORE */
font-family: "Roboto", sans-serif;

/* AFTER */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
             "Helvetica Neue", Arial, "Noto Sans", sans-serif, 
             "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

Content Font

/* BEFORE */
font-family: Helvetica, Tahoma, Arial, STXihei, "华文细黑", 
             "Microsoft YaHei", "微软雅黑", sans-serif;

/* AFTER */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
             "Helvetica Neue", Arial, "Noto Sans", "Noto Sans SC", 
             "Microsoft YaHei", sans-serif;

Code Blocks

/* BEFORE */
font-family: Helvetica, Tahoma, Arial...  /*  Wrong! Not monospace */

/* AFTER */
font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", 
             Consolas, "Courier New", monospace;  /* ✅ Proper monospace */

🌍 How It Looks on Different Platforms

PlatformFont UsedAppearance
macOSSan Francisco (-apple-system)Native macOS look
iOSSan FranciscoNative iOS look
WindowsSegoe UINative Windows look
AndroidRobotoNative Android look
LinuxVarious system fontsBest available system font

📱 Chinese Text Support

PlatformChinese FontQuality
Modern browsersNoto Sans SC⭐⭐⭐⭐⭐ Excellent
WindowsMicrosoft YaHei⭐⭐⭐⭐ Very Good
macOS/iOSPingFang SC (system)⭐⭐⭐⭐⭐ Excellent

⚡ Performance Impact

Before

After

🎨 Visual Impact

Typography Improvements

  1. Better Consistency
    • Same base font across all sections
    • Unified reading experience
    • Professional appearance
  2. Improved Code Readability
    • Proper monospace font for code
    • Clear distinction between 0 and O
    • Better character alignment
  3. Native Feel
    • Looks at home on every device
    • Users see familiar fonts
    • Reduces “foreign website” feeling

🔍 Technical Details

Files Modified

  1. assets/_scss/common/font-variables.scss (NEW - centralized font definitions)
  2. assets/_scss/default/body-main-styles.scss (line 37)
  3. assets/_scss/common/markdown-style.scss (lines 29, 51, 87, 137)

Changes Applied

📚 What Each Font Does

System Fonts in Order

  1. -apple-system → macOS/iOS native font (San Francisco)
  2. BlinkMacSystemFont → Older Chrome on macOS
  3. “Segoe UI” → Windows 7+ native font
  4. Roboto → Android native font
  5. “Helvetica Neue” → Older macOS fallback
  6. Arial → Universal fallback
  7. “Noto Sans” → Google’s universal font
  8. “Noto Sans SC” → Google’s Simplified Chinese font
  9. “Microsoft YaHei” → Windows Chinese font
  10. sans-serif → Browser default

Monospace Fonts for Code

  1. “SF Mono” → macOS/iOS monospace
  2. Monaco → Older macOS monospace
  3. “Cascadia Code” → Windows Terminal font (modern)
  4. “Roboto Mono” → Android monospace
  5. Consolas → Windows monospace
  6. “Courier New” → Universal fallback
  7. monospace → Browser default

💡 Next Steps (Optional Enhancements)

If you want to further improve typography, consider:

1. Add Font Loading Optimization

<!-- In your <head> section -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

2. Fine-tune Font Weights

Consider adjusting from 300 (light) to 400 (regular) for better readability:

// In markdown-style.scss
font-weight: 400;  /* Instead of 300 */

3. Optimize Line Height

Current 2.7rem is good, but you could test:

line-height: 1.6;  /* Relative to font-size */

4. Add Variable Font Support

For even better performance with multiple weights:

@supports (font-variation-settings: normal) {
  body {
    font-family: "Inter var", -apple-system, ...;
  }
}

🎓 Learning Resources

Want to learn more about web typography?

✨ Key Takeaways

  1. Zero-cost performance boost - System fonts load instantly
  2. Better user experience - Native look on every platform
  3. Improved readability - Professional font stack
  4. Perfect Chinese support - Multiple fallback options
  5. Future-proof - Uses modern best practices
  6. Maintainable - Standard approach, easy to understand

Questions?

If you have any questions about these changes or want to discuss alternative approaches, feel free to ask! The FONT_ANALYSIS.md file contains a detailed technical analysis with more options and recommendations.