Solved Thunderbird CSS font settings


Gorlash

Active member
Local time
6:34 PM
Posts
9
OS
Windows 11
I'm using Thunderbird beta V149.0b1 ...
I have now gotten all of my desired color settings configured, and decided to try to implement font settings as well...
At the moment, I'm only working with the Threads pane; this is what I have so far:

Code:
#threadTree tbody {
font-family: Canterbury Script !important;}
font-weight: normal !important;
font-size: 16px !important;
}

However, I'm having a couple of ambiguous results;
1. some fonts work, but others don't (these are all after-market truetype fonts that I obtained off the web).
So for example, Canaith works fine, CaligulaA and Calligrapher Regular do not work, and just leave me with some unknown sans-serif font,
Canterbury Script works, but displays very tiny, leading to my second issue:

2. the font-size field doesn't seem to have any effect.

Can anyone advise on these issues??
 

My Computer My Computer

At a glance

Windows 11Core i7
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
Acer
CPU
Core i7
Okay, I figured out issue 2 - it appears that font-size field wants to be first in the block; this works for several fonts:

Code:
#threadTree tbody {
font-size: 24px !important;
font-family: "Canterbury Script" !important;
/* font-family: "Caligula A" !important;*/
font-weight: normal !important;
}
 

My Computer My Computer

At a glance

Windows 11Core i7
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
Acer
CPU
Core i7
and issue 1 may simply be a matter of figuring out the correct name to use...
For example, using the font named Caligula A :

I have a Windows utility which displays all the installed fonts, and it displays the font name(s) returned by the Windows library function EnumFontFamiliesEx() ... it displays that font name as "CaligulaA", which does not work here.

I then looked at the Windows Fonts dialog; it shows this font as "Caligula A Regular" ... that *also* does not work...
However, if I treat the 'Regular' as being "font weight", and just use the rest, that appears to work...
In this case, "Caligula A" worked fine...

I'll test this on a few more fonts before tagging this thread as completed.
...
Of course, that is assuming that someone doesn't come along and say "NO NO NO, you are completely misunderstanding how this works !!!", in which case I will be open to new advice!!
 

My Computer My Computer

At a glance

Windows 11Core i7
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
Acer
CPU
Core i7
In Windows, you can also find the font family name in Settings > Fonts (note: the older Windows Explorer Fonts folder gives more information than the Settings App).

Also, the order of the different properties shouldn't matter - in the example you gave in post #1, you have closed off the Code block too early (there is one Opening brace and two Closing, so the font-weight and font-size were not valid). Then on further testing you changed both the order of the properties and removed the extra brace, hence all properties worked?

With some fonts, changes to font-weight might not be quite noticeable.

You can find more information about CSS font settings and other CSS settings at:

eg:
Win-Fonts.webp

Code:
#threadTree tbody {
font-family: "Caligula A"  !important; /* Caligula by itself also works for me */
font-weight: 1000          !important; /* very small noticeable diff. between 100 & 1000 */
font-size:   48px          !important;
}
TBird Font.webp
 
Last edited:

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
In Windows, you can also find the font family name in Settings > Fonts (note: the older Windows Explorer Fonts folder gives more information than the Settings App).

Also, the order of the different properties shouldn't matter - in the example you gave in post #1, you have closed off the Code block too early (there is one Opening brace and two Closing, so the font-weight and font-size were not valid). Then on further testing you changed both the order of the properties and removed the extra brace, hence all properties worked?

With some fonts, changes to font-weight might not be quite noticeable.

You can find more information about CSS font settings and other CSS settings at:

eg:


Code:
#threadTree tbody {
font-family: "Caligula A"  !important; /* Caligula by itself also works for me */
font-weight: 1000          !important; /* very small noticeable diff. between 100 & 1000 */
font-size:   48px          !important;
}
ahhh... you are right about issue 2 ... I had also noted at some point, that I had those extra closing braces in the original code, but I failed to go back and review all my assumptions afterwards, I just said "alright stupid, don't cause unneeded complications..." ... So that issue isn't relevant at all...

And thank you for the lead on Settings->Fonts ... that *does*, indeed, appear to provide the font name that I actually need for these instructions...

and it's ironic that, even though I managed to solve both issues, I didn't end up with understanding of them until you gave feedback!!
I'm very glad that you are still monitoring this site...
 

My Computer My Computer

At a glance

Windows 11Core i7
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
Acer
CPU
Core i7
BTW, @das10, I don't suppose you know of any Windows library functions that can be used to enumerate installed fonts, but provide the font name that is shown in Settings->Fonts ??? I have a font-enumeration program that I use to list installed fonts, but as I commented in an early post here, I use EnumFontFamiliesEx() ... that is the officially-documented method for obtaining this list, but it does not actually return the exact names that are required by other Windows operations...
 

My Computer My Computer

At a glance

Windows 11Core i7
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
Acer
CPU
Core i7
If you’d like to try it, I have a PowerShell script I obtained a while ago that produces an .html file in the user’s temp folder. The file lists details about the installed fonts and includes a sample of each one, and it opens automatically in the default browser. Unfortunately, the .html file doesn’t render properly in Firefox (it would require changes to how the file is generated, which I don’t know how to make), but it displays correctly in both Edge and Chrome.

Powershell:
$FontFolder = "C:\Windows\Fonts"
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FontFolder)

$attrList = @{}
for ($i = 0; $i -lt 300; $i++) {
    $name = $objFolder.GetDetailsOf($objFolder.Items, $i)
    if ($name) { $attrList[$name] = $i }
}

$FontData = foreach ($file in $objFolder.Items()) {
    [PSCustomObject]@{
        Name   = $objFolder.GetDetailsOf($file, $attrList["Title"])
        Family = $objFolder.GetDetailsOf($file, $attrList["Family"])
        Style  = $objFolder.GetDetailsOf($file, $attrList["Font style"])
        Type   = $objFolder.GetDetailsOf($file, $attrList["Font type"])
    }
}
$SortedFonts = $FontData | Where-Object { $_.Name } | Sort-Object Name

$ReportPath = Join-Path $env:TEMP "FontInventory.html"

$HtmlHeader = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
    body { font-family: 'Segoe UI', sans-serif; margin: 0; padding: 0; background-color: #f0f2f5; }
    
    .header-container { 
        position: sticky; top: 0; background: #0078d4; color: white; 
        padding: 15px 20px; z-index: 1000; display: flex; justify-content: space-between; align-items: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    .header-container h2 { margin: 0; font-size: 22px; }
    .print-btn { background: white; color: #0078d4; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; }

    table { border-collapse: separate; border-spacing: 0; width: 100%; background: white; table-layout: fixed; }
    
    thead th { 
        position: sticky; 
        top: 56px; /* Offset for the blue header */
        background-color: #005a9e; 
        color: white; 
        padding: 12px; 
        text-align: left; 
        z-index: 999; 
        border-bottom: 2px solid #004a87;
    }

    th:nth-child(1) { width: 20%; }
    th:nth-child(2) { width: 20%; }
    th:nth-child(3) { width: 60%; }

    td { padding: 12px; border-bottom: 1px solid #ddd; vertical-align: top; height: 1px; }
    
    .cell-flex { 
        display: flex; 
        flex-direction: column; 
        min-height: 80px; 
        height: 100%;
    }
    
    .bottom-info { margin-top: auto; color: #666; font-size: 0.85em; padding-top: 10px; }
    .preview { font-size: 22px; color: #111; line-height: 1.2; }
    .charmap { font-size: 13px; color: #777; margin-top: 8px; letter-spacing: 1px; word-break: break-all; }

    @media print {
        .header-container, thead th { display: none !important; }
        body { background: white; padding: 0; }
        table { border: 1px solid #ccc; border-collapse: collapse; }
        tr { page-break-inside: avoid; }
    }
</style>
</head>
<body>
    <div class="header-container"><h2>System Font Inventory</h2></div>
    <table>
        <thead>
            <tr>
                <th>Name / Details</th>
                <th>Font Family / Style</th>
                <th>Visual Preview & Character Map</th>
            </tr>
        </thead>
        <tbody>
"@

$Rows = foreach ($font in $SortedFonts) {
    $CharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz<br> 0123456789 !@#$%^&*()"
    
    "<tr>
        <td>
            <div class='cell-flex'>
                <strong>$($font.Name)</strong>
                <div class='bottom-info'>Type: $($font.Type)</div>
            </div>
        </td>
        <td>
            <div class='cell-flex'>
                $($font.Family)
                <div class='bottom-info'><em>Style: $($font.Style)</em></div>
            </div>
        </td>
        <td style='font-family: ""$($font.Name)"", ""$($font.Family)"";'>
            <div class='preview'>The quick brown fox jumps over the lazy dog.</div>
            <div class='charmap'>$CharMap</div>
        </td>
    </tr>"
}

$HtmlFooter = "</tbody></table></body></html>"
$HtmlHeader + ($Rows -join "") + $HtmlFooter | Out-File $ReportPath -Encoding utf8
Invoke-Item $ReportPath

FontInventoryhtml.webp
 

My Computer My Computer

At a glance

Win 11 25H2intel i7-870032GbIntel iGPU
OS
Win 11 25H2
Computer type
PC/Desktop
Manufacturer/Model
custom
CPU
intel i7-8700
Motherboard
Asus Z370 TUF Gaming
Memory
32Gb
Graphics Card(s)
Intel iGPU
Sound Card
Realtek
Hard Drives
Samsung
PSU
Corsair
Cooling
Fans
If you’d like to try it, I have a PowerShell script I obtained a while ago that produces an .html file in the user’s temp folder. The file lists details about the installed fonts and includes a sample of each one, and it opens automatically in the default browser. Unfortunately, the .html file doesn’t render properly in Firefox (it would require changes to how the file is generated, which I don’t know how to make), but it displays correctly in both Edge and Chrome.

Hah!! This should be interesting... I use console all the time, but I've never used PowerShell before!!
This will be a good learning experience...
Later note:
If anyone else comes across this thread and isn't familiar with PowerShell either, the script can be run from cmd.exe via this command:

powershell "& .\ShowFonts.ps1 "

If you want to remain in PowerShell after running the script, you can add -noexit to the line.

And this worked *beautifully* !! Thank you, @das10 !!
 
Last edited:

My Computer My Computer

At a glance

Windows 11Core i7
OS
Windows 11
Computer type
Laptop
Manufacturer/Model
Acer
CPU
Core i7
Back
Top Bottom