Comment puis-je add additional fonts vers le Windows console?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment puis-je add additional fonts vers le Windows console?

Message par ForumBot »

J'ai trouvé [a guide online](//wikihow.com/customize-the-font-in-windows-command-prompt) stating that vous devez edit le registre in order
to add nouveau fonts vers le list of disponible fonts in Invite de commandes: specifically,
vous devez edit the clé:

```
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont

```

by adding string valeurs avec clés `00`, `000`, `0000`, and so on, avec their
valeurs being the names du fonts. **I've déjà done this.** I added the
font names vers le registry, as vous pouvez dans le capture d'écran below, and redémarré
the ordinateur:

>


Cependant, the fonts which I've added ne sont pas showing up dans le list. More
specifically, I added Inconsolata and Source Code Pro. But Je ne vois pas them in
the list of disponible fonts:

>


What am I manquant? Je suis using Windows 10 version 1803, build 17134.165.
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment puis-je add additional fonts vers le Windows console?

Message par ForumBot »

## Comment add nouveau fonts to your `Powershell` (Or `CMD`) Console paramètres?

First thing to know, is that, malheureusement (!):

>


**Only fonts fulfilling certain criteria can be installé invers le console!**

(See: [here](https://web.archive.org/web/20160527080735/https://support.microsoft.com/en-us/kb/247815), [here](https://superuser.com/questions/390933/how-to-add-a-font-to-the-cmd-window-choices-in-windows-7-64-bit) and [here](https://superuser.com/questions/920440/how-to-add-additional-fonts-to-the-windows-console-windows).)

**The Font Criteria + Explanation**

*(The current status of c'est unknown.)*

For Font to be supported in Console they have to:

- The font doit être a **corrigé-pitch** font.

- The font cannot be an italic font.

- Si cela is a TrueTapez font, it doit être **`FF_MODERN`**.

- Si cela n'est pas a TrueTapez font, it must contadans le **`OEM_CHARSET`**.

- The font cannot have a *negative* **`A` or `C` space**.

**Que fait all that mean?**
Most duse metrics are defined [here](https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-taglogfonta), which outlines the following structure describing a font in C++:

```
typedef struct tagLOGFONTA {
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
CHAR lfFaceName[LF_FACESIZE];
} LOGFONTA, *PLOGFONTA, *NPLOGFONTA, *LPLOGFONTA;

```

-

*The font doit être corrigé-pitch.* pitch and family du font is described by the field `lfPitchAndFamily`. The two low-order bits specify the pitch du font and can be one du following valeurs:

- `DEFAULT_PITCH`

- `FIXED_PITCH`

- `VARIABLE_PITCH`

-

*The font cannot be italic.* In other words, the `lfItalic` field doit être set to false.

-

*Si cela is a TrueTapez font, the* `lfPitchAndFamily` *field must contadans le code for the **`FF_MODERN`** family*, in bits 4 through 7. `FF_MODERN` describes fonts avec a constant stroke width (i.e. monospace fonts), avec or sans serifs. *Monospace* fonts are usually modern. *Pica, Elite*, and *CourierNew* are examples.

-

*Si cela n'est pas a TrueTapez font, c'est charset must include **`OEM_CHARSET`**,* as defined by the `lfCharSet` field dans le `tagLOGFONTA` structure. That is, the font needs to be more than merely monospace. It également needs to support all the characters dans le OEM code page, the 437 "OEM" characters du `IBM437 (OEM United States)` char set as described [here](https://en.wikipedia.org/wiki/Code_page_437).

-

*The font cannot have a negative `A` or `C` space.* The width of a character is described by an [ABC structure](https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/ns-wingdi-_abc). The `B` spacing is the width du character. The `A` spacing is how much space to leave sur le *left* du character, and the `C` spacing is how much margin to leave sur le *right*.

Any character avec a negative margin sur le left or right is [oversized](https://blogs.msdn.microsoft.com/oldnewthing/20070516-00/?p=26843) the designated grid/raster. Par exemple, a font avec an overloaded `W` needs more space than the designated X pixel character width to properly draw the character. Obviously, fonts avec oversized characters ne sont pas corrigé-width.

Cependant, one known font to work and that a été suggested parce que it supports a lot of useful glyphs and math, is [DejaVu](https://dejavu-fonts.github.io/). Malheureusement it n'est pas part du Windows [standard font selection](https://docs.microsoft.com/en-us/typography/font-list/index)
and need to be installé manuellement.

Si le font you need ne déjà have a *TrueType* font fichier (**`*.ttf`**) or
*OpenType* (**`*.otf`**), vous allez need to convert the SFD fichiers into TTF (or OTF). To do so, vous pouvez use [FontForge](https://github.com/fontforge/fontforge/releases) to
import SFD and ensuite generate the TTF.

## Steps to installer a TTF fichier using *FontForge*

- Installer *FontForge* (hereafter "FF")

- Run FF as Administrator

- Téléchargez le SFD font fichier(s) (Par exemple: [DejaVuSansMono.sfd](https://github.com/CoryGH/dejavu-fonts/blob/master/src/DejaVuSansMono.sfd).)

- Ouvrez le fichier avec: `File > Open` and hit OK.

- Generate a TTF avec: `File > Generate Fonts...`, ensuite

- Sélectionnez **`True Type`** dans le drop-down, ensuite

- Un-Sélectionnez the `Validate Before Saving` option and hit **`Generate`**.

- Drag the resulting `*.ttf` fichier invers le Windows *Panneau de configuration* for Fonts found at:

(`Control Panel\Appearance and Personalisation\Fonts`) or by:
`WIN+R` and type: `%windir%\fonts`.

Done. The nouveau font is maintenant immediately disponible in your registry.

## Load the nouveau font(s) invers le Console registry

Open a Powershell console as `Administrator` to do this.

```
# All your available fonts are located here:
$T1key = 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts'

# But your Console fonts are located here:
$T2key = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont'

# Check the correct name:
Get-ItemProperty -Path $T1key | grep "DejaVu"
DejaVu Sans Mono (TrueType) : DejaVuSansMono.ttf
# Note the correct spacing of the name and ignore the "(TrueType)" part

# Check what's already there:
Get-ItemProperty -Path $T2key

# To add more fonts, just add the new name like this:
# - Add another 0 (zero) to the -Name parameter, for each new font
# So since there is already an item with two zeros, so we need 3 and 4 zeros...
#Set-ItemProperty -Path $key -Name '000' -Value 'Arial' # Doesn't work!
#Set-ItemProperty -Path $key -Name '0000' -Value 'Calibri' # Doesn't work!
Set-ItemProperty -Path $key -Name '00000' -Value 'DejaVu Sans Mono'

```

Cependant, **vous allez not see the nouveau font items, until**:

- le registre a été reloaded into mémoire, so la seule façon is to either:

- redémarrer the ordinateur or

- redémarrer `Windows Explorer`.

- Redémarrer your Powershell Console

- Fichier a bug report to Windows [Powershell repo](https://github.com/PowerShell/PowerShell) [Console repo](https://github.com/Microsoft/console) and ask them to:

**support proper Fonts avec correct unicode glyphs.**

Enjoy the many nouveau and correct glyphs!

Par exemple, try the [PH39](https://www.compart.com/en/unicode/U+2585):

`[char]0x2585 # (U+2585)`

Addendum:

- [Here](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts) is a long list of fonts that are more likely to work in Console.

- [https://stackoverflow.com/questions/49476326/displaying-unicode-in-powershell](https://stackoverflow.com/questions/49476326/displaying-unicode-in-powershell)

- [https://social.technet.microsoft.com/Forums/scriptcenter/en-US/c42a0300-1803-475d-9438-d39e6672cc69/unicode-characters-in-powershell](https://social.technet.microsoft.com/Forums/scriptcenter/en-US/c42a0300-1803-475d-9438-d39e6672cc69/unicode-characters-in-powershell)

- [UnicodeInfo](https://github.com/happysysadm/UnicodeInfo) - Powershell module to query the Unicode database

-

[WindowsConsoleFonts](https://github.com/Jaykul/WindowsConsoleFonts) - A PS module for fonctionnel avec Console fonts in Windows thdu toutow you to easily installer any (?) font.

-

Également see comment [merge two fonts](https://superuser.com/questions/490922/merging-two-fonts).

-

An informative Microsoft article about their [font technolgy](https://docs.microsoft.com/en-us/globalization/input/font-technology) and how `Font Linking` fonctionne.

-

The `Google Noto Project` (Font) [Noto Tools](https://github.com/googlei18n/nototools) for the Python based [merge_fonts.py](https://github.com/googlei18n/nototools/blob/master/nototools/merge_fonts.py).

-

One du criteria mentions to have *`constant stroke width`*, this means that the (pseuod-horizontal) pen width is constant as shown [here](http://fontforge.github.io/en-US/documentation/interface/elementmenu/):

>


The Expand Stroke dialog gives you control over various aspects du
expansion processus. First vous pouvez specify three types of pen nibs:



- A round pen, which is circular par défaut but may be transformed into an ellipse

- A rectangular pen, which is square par défaut but may be transformed into more traditional caligraphic nib shapes

- A polygonal pen – vous pouvez draw almost any convex polygon.




For circular and caligraphic pens vous pouvez chose a stroke width, how
the ends of an open chemin devrait être drawn, and how the chemin should look
when two splines (or lines) join which ne pas have the same slope (ie.
at a corner point).
Répondre

Revenir à « Personnalisation Windows »