Skip to content

Commit

Permalink
Add Scratch font to dropdown
Browse files Browse the repository at this point in the history
In TurboWarp it is actually ScratchSavers
  • Loading branch information
GarboMuffin committed May 10, 2024
1 parent cf0ca19 commit 0186bfb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/font-dropdown/font-dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ const ModeToolsComponent = props => (
getFontName={props.getFontName}
/>
</Button>
<Button
className={classNames(styles.modMenuItem)}
onClick={props.onChoose}
onMouseOver={props.onHoverScratch}
>
<DisplayFont
font={Fonts.SCRATCH}
getFontName={props.getFontName}
/>
</Button>
<Button
className={classNames(styles.modMenuItem)}
onClick={props.onChoose}
Expand Down Expand Up @@ -181,6 +191,7 @@ ModeToolsComponent.propTypes = {
onHoverKorean: PropTypes.func,
onHoverMarker: PropTypes.func,
onHoverPixel: PropTypes.func,
onHoverScratch: PropTypes.func,
onHoverSansSerif: PropTypes.func,
onHoverSerif: PropTypes.func,
onOpenDropdown: PropTypes.func
Expand Down
7 changes: 7 additions & 0 deletions src/containers/font-dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class FontDropdown extends React.Component {
'handleChangeFontMarker',
'handleChangeFontCurly',
'handleChangeFontPixel',
'handleChangeFontScratch',
'handleChangeFontChinese',
'handleChangeFontJapanese',
'handleChangeFontKorean',
Expand Down Expand Up @@ -91,6 +92,11 @@ class FontDropdown extends React.Component {
this.props.changeFont(Fonts.PIXEL);
}
}
handleChangeFontScratch () {
if (this.dropDown.isOpen()) {
this.props.changeFont(Fonts.SCRATCH);
}
}
handleChangeFontChinese () {
if (this.dropDown.isOpen()) {
this.props.changeFont(Fonts.CHINESE);
Expand Down Expand Up @@ -155,6 +161,7 @@ class FontDropdown extends React.Component {
onHoverKorean={this.handleChangeFontKorean}
onHoverMarker={this.handleChangeFontMarker}
onHoverPixel={this.handleChangeFontPixel}
onHoverScratch={this.handleChangeFontScratch}
onHoverSansSerif={this.handleChangeFontSansSerif}
onHoverSerif={this.handleChangeFontSerif}
onOpenDropdown={this.handleOpenDropdown}
Expand Down
1 change: 1 addition & 0 deletions src/lib/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Fonts = {
MARKER: 'Marker',
CURLY: 'Curly',
PIXEL: 'Pixel',
SCRATCH: 'Scratch',
CHINESE: '"Microsoft YaHei", "微软雅黑", STXihei, "华文细黑"',
JAPANESE: '"ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", Osaka, "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic"',
KOREAN: 'Malgun Gothic'
Expand Down

0 comments on commit 0186bfb

Please sign in to comment.