1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 15:37:44 +08:00
osu-lazer/osu.Game/Graphics/Containers/Markdown/OsuMarkdownHeading.cs

77 lines
2.3 KiB
C#
Raw Normal View History

2023-06-23 00:37:25 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2021-05-03 10:35:55 +08:00
// See the LICENCE file in the repository root for full licence text.
using Markdig.Syntax;
using osu.Framework.Graphics;
2021-05-03 10:35:55 +08:00
using osu.Framework.Graphics.Containers.Markdown;
using osu.Framework.Graphics.Sprites;
2021-05-03 10:35:55 +08:00
namespace osu.Game.Graphics.Containers.Markdown
{
2022-11-24 13:32:20 +08:00
public partial class OsuMarkdownHeading : MarkdownHeading
2021-05-03 10:35:55 +08:00
{
private readonly int level;
2021-05-03 10:35:55 +08:00
public OsuMarkdownHeading(HeadingBlock headingBlock)
: base(headingBlock)
{
level = headingBlock.Level;
2021-05-03 10:35:55 +08:00
}
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
public override MarkdownTextFlowContainer CreateTextFlow() => new HeadingTextFlowContainer
{
FontSize = GetFontSizeByLevel(level),
FontWeight = GetFontWeightByLevel(level),
};
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
protected override float GetFontSizeByLevel(int level)
{
2021-05-06 16:00:12 +08:00
// Reference for this font size
// https://github.com/ppy/osu-web/blob/376cac43a051b9c85ce95e2c446099be187b3e45/resources/assets/less/bem/osu-md.less#L9
// https://github.com/ppy/osu-web/blob/376cac43a051b9c85ce95e2c446099be187b3e45/resources/assets/less/variables.less#L161
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
switch (level)
{
case 1:
return 30;
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
case 2:
return 26;
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
case 3:
return 20;
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
case 4:
return 18;
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
case 5:
return 16;
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
default:
return 14;
change heading font size Heading 1 : 30px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/base.less#L12-L16 Heading 2 : 26px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L133-L134 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L169 Heading 3 : 20px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L147-L148 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L170 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L154 Heading 4 : 18px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L160-L161 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L171 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L153 Heading 5 : 16px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L174-L175 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L172 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L152 Heading 6 : 14px - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/bem/osu-md.less#L183-L184 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L173 - https://github.com/ppy/osu-web/blob/31579d45aa464a439e943250ca0d5fa7e05a1eb6/resources/assets/less/variables.less#L150
2021-05-03 10:35:59 +08:00
}
}
protected virtual FontWeight GetFontWeightByLevel(int level)
{
switch (level)
{
case 1:
case 2:
return FontWeight.SemiBold;
default:
return FontWeight.Bold;
}
}
2022-11-24 13:32:20 +08:00
private partial class HeadingTextFlowContainer : OsuMarkdownTextFlowContainer
{
public float FontSize;
public FontWeight FontWeight;
protected override SpriteText CreateSpriteText()
2021-08-03 23:14:44 +08:00
=> base.CreateSpriteText().With(t => t.Font = t.Font.With(Typeface.Torus, size: FontSize, weight: FontWeight));
}
2021-05-03 10:35:55 +08:00
}
}