This component allows you to set the main site font, and optionally separate fonts for headlines and monospaced text (code blocks). You can also choose a font weight in each case, and increase the font size.
Behind the scenes this sets up a little bit of CSS along with Google’s font <link>. Note that this is relying on Google to serve the font files from https://fonts.googleapis.com/.
Settings
Name
Description
fonts
Add the name of the font(s) you want to use from fonts.google.com. Note that font names are CaSe SeNsiTivE!
body font
The main font used throughout Discourse, must be included in “fonts” setting above
body font weight
Font thickness in the range of 100-900. 400 is normal, 700 is bold
headline font
Optional font for headlines, must be included in “fonts” setting above
headline font weight
Font thickness in the range of 100-900. 400 is normal, 700 is bold
monospaced font
Optional font for code blocks, must be included in “fonts” setting above.
monospaced font weight
Font thickness in the range of 100-900. 400 is normal, 700 is bold
normal font size
Default font size for all users, adjusting this will adjust all font sizes proportionately
smaller font size
Selectable in each user’s interface preferences
larger font size
Selectable in each user’s interface preferences
largest font size
Selectable in each user’s interface preferences
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
تقرير خطأ سريع: لاحظت للتو أنه عندما أقوم بتعيين وزن الخط، فإن النص الغامق لا يظهر كغامق.
لقد اختبرت هذا باستخدام خطوط Work Sans و Zilla Slab. قمت بتغيير وزن الخط من الافتراضي (400) إلى 300. عندما فعلت ذلك، لم يظهر النص الغامق كغامق. قمت بإعادة تعيين هذا الإعداد وعاد النص الغامق للظهور.
لقد قمت بتعيينه على 400 وانتهيت من ذلك، لكنني أردت إخبارك.
هل هناك طريقة للتعمق قليلاً في التفاصيل؟ يأتي خط “العنوان” بوزن 900 افتراضيًا مع العناوين داخل المواضيع. سيكون من الرائع تعيين القيم الافتراضية لكل من كائنات Markdown هذه.
لقد قمت للتو بدمج إعادة هيكلة لهذا المكون والتي تتماشى بشكل أفضل مع تحديثات Google Font — يجب أن يؤدي هذا إلى حل بعض المشكلات التي كان يواجهها الأشخاص مع عدم ظهور أوزان مختلفة.
لاحظ أن تنسيق الإعداد قد تغير قليلاً بحيث لم يعد من الممكن تضمين الأوزان في إعداد اسم الخط مثل Roboto:300,300i,500، ويجب تحديث هذا إلى Roboto بسيط… ولكن يجب أن يتم الترحيل تلقائيًا عند التحديث.