How to insert musical character “flat” in writer or calc?

Hello :slight_smile:

How to insert musical character “flat” in writer or calc?
I tried with U+266D then Alt+x, but I have spaces before and after the flat " b "?

I’m with Windows 10, LibreOffice 7.4.4.2 (x64)

Thanks in advance :slight_smile:
Music characters.odt (8.8 KB)

menu:Insert>Special Characters…
Search for music.
Characters 9837, 9838 and 9839: ♭♮♯
Note that some fonts do not include these characters.

1 Like

Edit 1 your question (don’t use a comment) to mention OS name and LO version. Here with 7.4.5.1 under Fedora 37 (Linux), no spurious spaces.

Edit 2
Please attach a sample document where space insertion occurs.

Edit 3
Your sample file has no spaces around the characters. When I insert another one, no space appears.
In your real document, have you modified kerning of these character thus expanding the inter-character distance (not real space chars)?
Which font are you using?

1 Like

Cross post: Dièse et bémol dans writer et calc.

Yes, but i have spaces before and after the flat on my system ?
I have tried all the fonts without success.

I tried a few fonts, see attached document, text on left and image on right because missing fonts will show differently and also different operating systems might handle missing characters differently. You can see that there seem to be only three different sets of characters.

Segoe UI Symbol gives closest spacing but the license is restricted to Microsoft products like Windows or MS Office, see Font redistribution FAQ - Typography | Microsoft Learn. This is the fallback font for symbols in MS Office I suppose.

I think you should find a specific music font to use because the character spacing should be correct for a font designed specifically for music.
[EDIT] I incorrectly said Segoe UI, it should have been Segoe UI Symbol. Updated .odt below with correct font name
Music characters87537EA.odt (31.3 KB)

[Edit 2023-02-07]
I did some experiments with Word 2010 and found that Word sometimes selects MS Gothic Font (monospaced font that looks very similar to one of the wider ones in the LO sample) and sometimes Arial Unicode MS which spaces correctly. Arial Unicode MS has the advantage of a somewhat less restrictive licence than Segoe UI.

A better option would be Noto Music licensed under OFL and downloadable from Google Fonts: Noto Music

1 Like

To get good music symbols fonts (i.e., Bravura Text), you can install MuseScore.
imagen

1 Like

It is possible to use macro to detect the existence of character in installed fonts.

Sub isCharInFont 'test in which fonts the charater is
	dim oDoc as object, oWindow as object, oFont as object, oFonts(), i&, sChar$, col as new collection, s$
	oDoc=ThisComponent
	oWindow=oDoc.CurrentController.Frame.ContainerWindow
	oFonts=oWindow.FontDescriptors
	s=inputBox("U+", "Hexa value")
	if s="" then exit sub
	sChar=chr("&H" & s & "&") 'tested character in hexa code
	on local error resume next 'need for the method col.add
	for i=lbound(oFonts) to ubound(oFonts)
		oFont=oWindow.getFont(oFonts(i))
		if oFont.hasGlyphs(sChar) then
			col.add(oFont.FontDescriptor.Name, oFont.FontDescriptor.Name) 'get unique names of fonts, so it ignores the regular/italic/bold etc.
		end if
	next i
	dim p(col.Count-1)
	for i=1 to col.Count
		p(i-1)=col(i)
	next i
	GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
	msgbox(join(SF_Array.sort(p), chr(13)), 0, sChar & " is in fonts") 'show sorted names of fonts
End Sub

The characters U+266D, U+266E, U+266F are in DejaVu Sans or DejaVu Serif.


Good font with musical symbols is Leland (for example it is implemented in program MuseScore). But the disadvantage is this font hasn’t the musical symbols in proper Unicode positions but in the Private Use Area started at U+E000 :-(.

1 Like

This means that Leland is a legacy 256-Characters DOS/Windows font which has been masqueraded as a “Unicode” font by some automatic means where glyphs in 0x80-0xFF have been relocated into the PUA. So expect other encoding problems with such a font.

1 Like

It is worst, Leland GitHub - MuseScoreFonts/Leland: A SMuFL-compliant OpenType music font has only Private use charaters :-(. I used it to implement some character to own font.

1 Like

Thanks for the help.
Segoe UI Symbol and MetDemo (a first font I downloaded) both do the job.

You sure that are SpaceCharacters? I only find one character wider than should be expected, and by that suggesting there might be spaces.

As a musically illiterate person, I wonder if there might be two slightly different uses for “flat”: Maybe a wider one, with continuation for the rest of the line, and a narrower one, which only affects the next note.

In this case, the font rendering of a system might use “wide” where “narrow” is meant, and the correct “wide” might not even be present in the font or as a code point, because it could be represented by “narrow”+spaces…

1 Like

I’m not sure because this is the first time I need to use these musical characters.
But now I have two fonts, Segoe UI Symbol and MetDemo, which do the job :slight_smile:

No. and yes. :slight_smile:
In written music, if it appear as key signature (usually in groups, at the beginning of a staff), it modifies notes until there is another key signature.
If it appear in front of a single note, it modifies this note and the following ones in the same measure (space between vertical lines).
Both are the same size.
But it can follow a chord name (i.e., Mi♭ or E♭, for guittar accompaniment, etc.).

2 Likes