4D Blog

Home Product Substitute missing fonts in 4D Write Pro documents

Substitute missing fonts in 4D Write Pro documents

June 11, 2019

Product

Prior to 4D v17 R5, you may have discovered upon opening your 4D Write Pro document that the displayed font is not what it is supposed to be! If the document contains fonts which are not on your computer, 4D automatically replaced them with Times New Roman. However, since font preference is a matter of individual choice, this R-release gives you the ability to choose the replacement fonts!

Thanks to this feature, you can define which font will be used if the original one is missing. This can be done on both macOS and Windows operating systems.

A new attribute is added for this purpose: wk font default. It’s an object defining the default substitution font(s) for a document. It contains three properties:

  • default: The font to use by default as a substitute if a font is not supported by the OS, regardless of the platform.
  • Windows: The font to use by default on Windows (priority over “default”, if defined).
  • mac: The font to use by default on macOS (priority over “default”, if defined).

Example

In the example below, we want to define a collection of fonts to be used hierarchically in case the main font doesn’t exist. In other words, if the Roboto Condensed Bold Italic font doesn’t exist on my macOS, the fonts in the collection will be used, in the order of their definition: 

$o:=New object
$o.mac:=New collection("Helvetica";"Morocco Regular";"Arial Black")
WP SET ATTRIBUTES(wpDOC;wk font;"Roboto Condensed Bold Italic")
WP SET ATTRIBUTES(wpDOC;wk font default;$o)

What about converted 4D Write documents?

The substitution font in converted 4D Write documents is “Times New Roman”, regardless of the platform. If an imported font is not supported on the platform, it’s replaced by “Times New Roman” when rendering the document at runtime.

Discuss

Tags 4D Write Pro, v17 R5, v18, Word processor

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Avatar
Intissar Elmezroui
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy