Hi everyone,
I’m having an issue with using my installed font in Obsidian. I have two styles of the same font: a regular version at weight 400 and a semibold (DB) version at weight 600. Initially, I tried modifying the semibold’s metadata to weight 700 so it would be used as bold in editing and preview, but the 700 version became corrupted for bold italic—only the bold (non-italic) worked correctly. As a result, I removed the altered 700 version and reverted to the original semibold file (which remains at weight 600).
Now, my CSS snippet uses weight 600 for the semibold variant, but the problem is that Obsidian expects bold styling to be weight 700. I need to force Obsidian to use the semibold (600) version as if it were 700 for both bold and bold italic.
Below is my current snippet:
cssCopy code
/* Define the regular font */
@font-face {
font-family: 'A P-OTF Bunkyu Gothic Pr6N';
src: local('A P-OTF Bunkyu Gothic Pr6N R');
font-weight: 400;
font-style: normal;
}
/* Italic variant for the regular font */
@font-face {
font-family: 'A P-OTF Bunkyu Gothic Pr6N';
src: local('A P-OTF Bunkyu Gothic Pr6N R');
font-weight: 400;
font-style: italic;
}
/* Define the semibold variant (to be used as bold) at weight 600 */
@font-face {
font-family: 'A P-OTF Bunkyu Gothic Pr6N';
src: local('A P-OTF Bunkyu Gothic Pr6N DB');
font-weight: 600;
font-style: normal;
}
/* Italic variant for the semibold font */
@font-face {
font-family: 'A P-OTF Bunkyu Gothic Pr6N';
src: local('A P-OTF Bunkyu Gothic Pr6N DB');
font-weight: 600;
font-style: italic;
}
/* Apply the font only to editing and preview areas */
/* Markdown Editor */
.markdown-source-view > .cm-editor > .cm-scroller {
font-family: 'A P-OTF Bunkyu Gothic Pr6N', sans-serif;
}
/* Rendered & Reading View */
.markdown-preview-view,
.markdown-rendered {
font-family: 'A P-OTF Bunkyu Gothic Pr6N', sans-serif;
}
The regular (400) and its italic variant work perfectly. However, when I apply bold styling, Obsidian expects a weight of 700 and doesn’t automatically use the semibold (600) version. I need to force Obsidian to interpret the semibold (weight 600) as bold (700), including for the bold italic style, since modifying the metadata to 700 resulted in issues with the bold italic rendering.
Has anyone found a workaround or a snippet tweak that can force Obsidian to use weight 600 as if it were 700? Any suggestions would be appreciated!
Thanks in advance for your help!