Turning off font ligatures in CSS (letter connections deactivation)

Typically, modern web browsers will automatically merge certain letter combinations, such as 'f' and 'i', into a single character known as a ligature. While this can enhance readability, it may not always align with a designer's preferences.

I personally encountered this problem in Chrome (Version 53.0.2785.101). Although I cannot guarantee, it seems likely that this issue exists in other versions of Chrome as well.

Chrome: https://i.stack.imgur.com/fmNEr.png 'f' and 'i' are combined multiple times

Edge: https://i.stack.imgur.com/rYdkH.png

IE11: https://i.stack.imgur.com/l4Yti.png

In this particular scenario, I sought a solution to disable this feature.

Answer №1

After some investigation, it became clear that achieving this was indeed possible with a bit of effort. According to MDN, you can disable common ligatures by using the following CSS:

font-feature-settings: "liga" 0;

However, a more recommended approach would be to utilize the font-variant-ligatures property instead:

font-variant-ligatures: none;

Both properties achieve the same outcome, but the latter one is preferred.

As mentioned on MDN:

Note: It is advisable for web developers to use the font-variant shorthand property or its corresponding longhand properties like font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric, or font-variant-position whenever possible.

The usage of this property should be limited to specific cases where other methods of enabling OpenType font features are unavailable.

This CSS property should not be employed for enabling small caps in fonts.

Answer №2

I had a similar issue and found my way here via a Google search. I really dislike ligatures appearing on any website. (I noticed that when I convert a webpage to PDF and use the text-to-speech feature, it skips over the ligatures.) Luckily, I discovered a solution that works well for me:

Simply open the webpage using Chrome on Linux (this method may also work on other desktop operating systems). Install the StyleBot extension for Google Chrome. Then, go to its settings, select "styles", and click on "edit global stylesheet". Input the following code (borrowed from the answer by @AwesomeGuy).

body {
font-variant-ligatures: none;
font-feature-settings: "liga" 0;
}

Make sure to activate the global stylesheet. Voilà, Chrome will no longer display ligatures (characters will be shown separately). Additionally, when printing web pages as PDFs in Chrome, characters are displayed individually.

Answer №3

Make sure to save this as a bookmark and only click once when you're ready to print.

javascript: void(function () {
    var css = `
    * {
        font-variant-ligatures: none!important;
        font-feature-settings: "liga" 0!important;
    }
    `;
    var head = document.head || document.getElementsByTagName('head')[0];
    var style = document.createElement('style');
    style.type = 'text/css';
    if (style.styleSheet) {
        /*This is necessary for IE8 and earlier versions.*/
        style.styleSheet.cssText = css;
    } else {
        style.appendChild(document.createTextNode(css));
    }
    head.appendChild(style);
    /*You can opt not to set a delay here.*/
    setTimeout(function () {
        window.print();
    }, 2000);
})()

Instructions on Adding Javascript Applets to Bookmarks in Chrome

Open a New Tab in Chrome. Use Command+T on a Mac, Ctrl+T on a Windows.
Right-click on the Bookmarks Toolbar within Google Toolbar, located on Chrome's New Tab page.
From the contextual menu, select “Add Page”.
Name your Bookmark appropriately. If you need ideas, consider searching for “Baby Names” or choose names like Shepherd, Samson, or even Samsonite for luggage related inspirations.
Paste the Javascript applet into the URL field.
Save your new Bookmark and you're all set to complete this tutorial!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Vertically Center Image in a Div

I have been struggling to center an image within a div, but all the usual methods like using margin: auto; do not seem to work. I have tried various popular techniques with no success. <style> /* Add a black background color to the top navigation ...

What is preventing my image from moving upwards?

I've been struggling to move this image up, despite trying several methods. I really want it to be aligned horizontally with the PV picture. I need the HP image to be moved directly upwards so that it aligns horizontally with the PV image. This is t ...

Tips for refreshing CSS following an ajax request

Currently, I am facing an issue with the CSS formatting on my page. I am using Django endless pagination to load content on page scroll. However, when new content is loaded, the CSS applied to the page does not work properly and needs to be refreshed. Can ...

Tips for enabling background scrolling when Popover is displayed: (React, React Native, Native-Base)

I'm utilizing the Popover component from NativeBase to design my popover: const SettingsButton: React.FC<Props> = () => { return ( <Popover trigger={(triggerProps) => { return ( ...

Flexslider doesn't adjust the height of the viewport when displaying a shorter image in the slideshow

Is Flexslider not resizing its viewport height according to the current image on your site? The fixed height seems to be causing blank white space under shorter images. Are you inadvertently overriding Flexslider's responsive height function? Is there ...

What could be causing ReactNative Dimensions component to display lower resolutions?

Currently, I am developing an application using React Native v0.45.1 and testing it on my S6 device. Despite setting a background image that matches the resolution of my phone, it appears excessively large on the screen, cutting off most of the content. T ...

Error TS2307: Module './tables.module.css' or its type declarations could not be located

Currently utilizing CSS modules within a create-react-app project and encountering an error within Google Chrome browser: https://i.stack.imgur.com/0ItNM.png However, the error appears to be related to eslint because I am able to close the warning modal i ...

Adapting a CSS design

Having some trouble with creating a CSS style. Here's what I have so far: http://jsfiddle.net/WhNRK/26/ Originally designed for a label, but now attempting to modify it for something like this: <input type='radio' name='mcq' ...

Is there a way to initiate a jquery function upon loading the page, while ensuring its continued user interaction?

On my webpage, there is a JavaScript function using jQuery that I want to automatically start when the page loads. At the same time, I want to ensure that users can still interact with this function. This particular function involves selecting a link tha ...

Is there a way for me to determine if a user has engaged with a form?

I'm surprised by how difficult it was to find information on this topic through Google. Currently, my struggle lies in wanting my form fields to change color based on validity only after the user has interacted with the form. I don't want invali ...

Styling images side by side with CSS in Internet Explorer

I've encountered a CSS dilemma. I have a collection of images that I want to present side by side using an unordered list within a fixed width container. The goal is to have 3 images per row before moving on to the next set of 3 images. Each list ite ...

Achieving True WYSIWYG Performance in TinyMCE 4.x: Tips and Tricks

Currently, I am in the process of developing a custom CMS where I am integrating tinymce to empower users to create page content, similar to what is seen on Wordpress. The content inputted by users in the admin area will be showcased within a designated el ...

Creating an SVG element that adjusts to the size of its parent container: tips and tricks

I'm attempting to achieve the following: Displaying an SVG square (with a 1:1 aspect ratio) inside a div element. When the width of the div is greater than its height, the square should adjust to fit within the container based on the height (red box ...

Retrieve data from HTML in order to apply styling to an element

I am attempting to set the width of my .bar-1 outer span element based on the value of my inner span element. <span class="bar bar-1"> <span name="PERCENTAGE" id="PERCENTAGE" disabled="" title="Total Percentage" maxlength="255" value="66" tabinde ...

Incorporating list view separators using JQuery Mobile

I recently started using the Jquery Mobile Flat UI Theme and I'm really impressed. However, I would like to enhance it by adding a separator between each listview. Here is my current listview: Can someone please advise me on which code I need to add ...

What is the process for encoding images in HTML code?

Is there a method to embed a background image directly in the HTML code? For instance: background-image: url(data:image/gif;base64,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX); If I have an image file, can I encode its data and t ...

Is there a way to delay loading 'div' until a few seconds after the 'body' has been fully loaded?

Is there a way to delay the appearance of the "text-container" div after the image is displayed? I have attempted to achieve this using JavaScript with the following code: <script> window.onload = function(){ var timer = setTimeout("showText()",700 ...

Establish a vertical column that matches the height of its parent element

Is there a way to create a column that matches the height of its parent element? I have a navbar followed by a container with three columns. The challenge is to make the last right column the same height as its parent and also scrollable. In this scenario, ...

A guide to incorporating external CSS files in Angular 5 components using styleUrls

I have a unique setup where my Angular 5 application resides in a subdirectory within another parent application. The parent application consists of JSP and other AngularJS applications among other things. My goal is to include a CSS file from the parent ...

Creating CSS-in-JS Components in React JS without External Stylesheet interference

import React, { Component } from "react"; import './navbar.css' class NavBar extends Component { render() { return ( <div> navbar content </div> ); } } export default NavBar; If I were to ...