Your own custom maintenance mode for WordPress

The custom maintenance mode message in WordPress, during upgrades and installs, is far from beautiful 🙂 Time to change that! You can do your own page by adding a pure PHP maintenance.php into your /wp-content folder. Now go and build a nice page ! Just remember that during maintenance no WordPress functionality is available! Enjoy coding …

You might not need jQuery or Javascript!

Transition jQuery has provided easy access to complicated core Javascript solutions in the past and has been shielding us from difficult workarounds for legacy browsers. But times have changed and many of those things can be done as easily using Javascript directly. jQuery is a fast, small, and feature-rich JavaScript library. It makes interactions with HTML documents […]

WPML – Going multilingual with WordPress

Getting started “WPML (WordPress Multilingual) makes it easy to build multilingual sites and run them. It’s powerful enough for corporate sites, yet simple for blogs.” – WPML I have been running and setting up multilingual websites for more than 12 years. WordPress and related integrations have gladly come a long way to make our life’s […]

WP REST API rendered output & Visual Composer

Visual Composer shortcodes are normally not converted within the WordPress REST API rendered output. This can be accomplished by calling WPBMap::addAllMappedShortcodes(); add_action( ‘rest_api_init’, function () { register_rest_field( ‘page’, ‘content’, array( ‘get_callback’ => ‘convert_do_shortcodes’, ‘update_callback’ => null, ‘schema’ => null, ) ); }); function convert_do_shortcodes( $object, $field_name, $request ) { WPBMap::addAllMappedShortcodes(); // This does all the work global […]

World Grain / Milling & Grain – vibronet® advertisment 2025

World Grain + Milling & Grain magazine advertisment 2025 World GrainMilling & Grainvibronet® Gräf GmbH & Co. KG

WordPress: Caching MO-files … Does it make any sense!

First a bit of context 🙂 What is Gettext? Translation within WordPress is based of Gettext. Gettext is a software internationalization and localization (i18n) framework used in many programming languages to facilitate the translation of software applications into different languages. It provides a set of tools and libraries for managing multilingual strings and translating them […]

WordPress Plugins & Sessions

START SESSION ON INIT add_action(‘init’, ‘pluginStartSession’, 1); function pluginStartSession() { if(!session_id()) { session_start(); } } NEW SESSION ON LOGIN / LOGOUT add_action(‘wp_logout’, ‘pluginEndSession’); add_action(‘wp_login’, ‘pluginEndSession’); function pluginEndSession() { session_destroy (); } Now go ahead and use $_SESSION freely in your plugin. Here a nice additional class to  encrypt session data. Enjoy coding ….

WordPress Cron + WP-CLI + Ntfy

THE GOAL Create a system cron for WordPress, that is accessible and can be easily tweaked to provide more details. Here some basic information about crons and the tools I am going to use … WordPress CRON In WordPress, the term “cron” refers to the system used for scheduling tasks to be executed at predefined […]

WordPress + Query_Posts + Sticky + Pagination

We often have some posts that we would like to promote and keep at the first page of the blog. When you are using pagination, the sticky posts will be added to the standard posts, making the post count per page uneven. If you want to keep your posts per page count consistent, there is […]

Willen Logistics | Business Cards

I designed a fresh set of business cards for Willen Logistics last year, this is a small iteration with a QR-Code on the back. The business cards feature a partial varnish on the logo and QR-Code. I updated their different logos last year, to streamline their main corporate colors. “Seit mehr als 50 Jahren ist […]

Options to detect when a @font-face has been loaded

12. May 2016
.SHARE

Table of Contents

What is a @font-face?

@font-face is a CSS at-rule used to define custom fonts for use on web pages. It allows web designers and developers to specify downloadable fonts that can be used to render text on their websites, regardless of whether the font is installed on the user’s device.

What is the FOUT, FOIT or FOFT?

There are three common issues regarding text rendering on browsers. And the goal always is to reduce or at least minimize the text reflow.

What the FOUT!

FOUT stands for “Flash of Unstyled Text.” It’s a phenomenon that occurs when using web fonts in CSS. When a web page is loading, the browser might initially render text using a fallback font while waiting for the web font to download and apply. This results in a momentary flash where the text appears in the fallback font before switching to the desired web font.

FOUT can be visually disruptive, especially if the fallback font differs significantly from the intended web font in terms of style or size. To mitigate FOUT, web developers often use techniques such as font loading strategies (like using the font-display property in CSS) or server-side rendering to ensure that the desired web font is loaded and applied as quickly as possible to minimize or eliminate the flash of unstyled text.

What the FOIT!

FOIT stands for “Flash of Invisible Text.” It’s another phenomenon related to web fonts in CSS. Unlike FOUT, where fallback text is briefly visible before the web font loads, FOIT occurs when the browser hides text until the web font is fully loaded and ready to be applied.

When FOIT happens, the text remains invisible until the browser has downloaded the web font. This can result in a delay in displaying text content on the webpage, which might lead to a poor user experience.

To address FOIT, web developers sometimes use techniques such as font loading strategies (like preloading fonts or using the font-display property) to ensure that text content remains visible while waiting for web fonts to load. These techniques aim to balance the trade-off between the performance benefits of font loading and the user experience of text visibility.

What the FOFT!

“FOFT” stands for “Flash of Faux Text.” This term describes a phenomenon similar to FOUT (Flash of Unstyled Text) but specifically occurs when using synthetic fonts, such as system fonts or web-safe fonts, instead of custom web fonts.

In FOFT, when a web page is loading, the browser may initially render text using a generic font (like Arial or Times New Roman) before switching to the specified font once it has fully loaded. This switch can result in a brief flash where the text appears in the generic font before being replaced with the intended font, causing a disruption in the visual appearance of the text.

To mitigate FOFT, developers can employ similar techniques used to address FOUT, such as optimizing font loading strategies or utilizing font preloading techniques to ensure a smoother transition from the generic font to the specified font. Additionally, choosing system fonts or web-safe fonts that closely resemble the desired custom font can help reduce the visibility of FOFT.

DETECT WHEN FONTS ARE LOADED!

Option 1

Use the CSS font loading API. Not supported in all browsers yet (MDN, W3C). You can call document.fonts  to get a FontFaceSet object.

  • check(fontSpec) – returns whether all fonts in the given font list have been loaded and are available. The fontSpec uses the CSS shorthand syntax for fonts.
    Example: document.fonts.check('bold 16px Roboto'); // true or false
  • document.fonts.ready – returns a Promise indicating that font loading and layout operations are done.

Option 2

Use Font Face Observer – its a small @font-face loader and monitor compatible with any web font service. It will monitor when a web font is applied to the page and notify you. It does not limit you in any way in where, when, or how you load your web fonts. Unlike the Web Font Loader Font Face Observer uses scroll events to detect font loads efficiently and with minimum overhead.

GitHub

Option 3

Use jQuery-FontSpy.js, works by checking the change in width of a string.

GitHub

Option 4

Use Webfont Loader,  if loading fonts from Typekit , Fonts.com, Google, Fontdeck or custom location.

This introduces the following events:

  • loading – This event is triggered when all fonts have been requested.
  • active – This event is triggered when the fonts have rendered.
  • inactive – This event is triggered when the browser does not support linked fonts or if none of the fonts could be loaded.
  • fontloading – This event is triggered once for each font that’s loaded.
  • fontactive – This event is triggered once for each font that renders.
  • fontinactive – This event is triggered if the font can’t be loaded.

GitHub

Enjoy coding …

Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

Pushing the Boundaries – My Journey Through Early CMS and PHP Development

Back in the early 2000s, content management systems (CMS) were still in their infancy. Websites were mostly static, and managing content dynamically required custom scripts or early blogging tools. My journey into CMS development started with Greymatter, took me through PHP-Nuke, PostNuke, and XOOPS, and ultimately shaped my understanding of PHP and modular web development. […]

Enhancing WordPress Development with the Timber Template System

WordPress has long been the go-to CMS for developers and designers, but its traditional PHP-based templating system can sometimes feel outdated and cumbersome. Enter Timber, a powerful templating framework that brings the flexibility and clarity of the Twig templating language to WordPress. With Timber, developers can separate logic from presentation, leading to cleaner, more maintainable code. All my […]

Day 4: Kimai Time Tracking – 7 Days of Docker

Kimai is a powerful open-source time-tracking application that helps businesses and freelancers efficiently manage work hours and billing. It supports multi-user environments, customizable reporting, and integrations with various tools. In this guide, we’ll walk through setting up Kimai using Docker and explore how to use it effectively. Why Use Kimai with Docker? Running Kimai with […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.