WordPress.org

Make WordPress Core

Opened 4 weeks ago

Closed 5 days ago

#45408 closed defect (bug) (fixed)

Twenty Seventeen: Error font-family style for Simplified Chinese (zh_CN).

Reported by: ze3kr Owned by: laurelfulford
Milestone: 5.0.2 Priority: normal
Severity: normal Version: 5.0
Component: Bundled Theme Keywords: commit has-patch fixed-5.0
Focuses: Cc:

Description

In wordpress 5.0 (5.0-RC1-43944):

/wp-content/themes/twentyseventeen/assets/css/editor-blocks.css (For the new block editor)

Line 160:

/* Typography for Chinese Font */

html[lang^="zh-"] .edit-post-visual-editor .editor-block-list__block,
html[lang="zh-CN"] .edit-post-visual-editor .editor-block-list__block {
	font-family: "PingFang TC", "Helvetica Neue", Helvetica, STHeitiTC-Light, Arial, sans-serif;
}

zh-CN should use SC, but not TC. Or the type of character is not correct. Similar to: #39379

Should be changed to:

/* Typography for Chinese Font */

html[lang^="zh-"] .edit-post-visual-editor .editor-block-list__block {
	font-family: "PingFang TC", "Helvetica Neue", Helvetica, STHeitiTC-Light, Arial, sans-serif;
}

html[lang="zh-CN"] .edit-post-visual-editor .editor-block-list__block {
	font-family: "PingFang SC", "Helvetica Neue", Helvetica, STHeitiSC-Light, Arial, sans-serif;
}

Attachments (3)

45408.patch (1.3 KB) - added by vaishalipanchal 4 weeks ago.
Patch.
45408.2.patch (817 bytes) - added by vaishalipanchal 4 weeks ago.
Updated patch.
45408.3.patch (1015 bytes) - added by vaishalipanchal 4 weeks ago.
Updated patch.

Download all attachments as: .zip

Change History (16)

#1 @ze3kr
4 weeks ago

I have also checked 2019 theme, and it does NOT have the same problem. It has set the font family for zh-CN correctly.

#2 @vaishalipanchal
4 weeks ago

  • Component changed from Themes to Bundled Theme

Hi @ze3kr, Welcome to WordPress Trac! Thank you for your ticket.

As per your ticket if above Chinese(zh_CN) font issue is in Twenty Seventeen theme editor-blocks.css then theme is also use STHeitiTC-Light font family so needs to fix that also.

To contribute with patch refer this article - https://make.wordpress.org/core/handbook/contribute/git/#patches

@vaishalipanchal
4 weeks ago

Patch.

#3 @ze3kr
4 weeks ago

Hi, I think the patch is incorrect (for both 2 files). And the original wp-content/themes/twentyseventeen/style.css is fine.

#4 @ze3kr
4 weeks ago

For Chinese other than Simplified Chinese, it should use TC:

font-family: "PingFang TC", "Helvetica Neue", Helvetica, STHeitiTC-Light, Arial, sans-serif;

For Simplified Chinese, it should use SC.

font-family: "PingFang SC", "Helvetica Neue", Helvetica, STHeitiSC-Light, Arial, sans-serif;

Note that there are 2 fonts need to specify SC and TC, PingFang and STHeiti.

So the style.css is fine(fixed in #39379 ), but not the editor-blocks.css.

Last edited 4 weeks ago by ze3kr (previous) (diff)

@vaishalipanchal
4 weeks ago

Updated patch.

#5 @ze3kr
4 weeks ago

45408.2.patch misses the "PingFang SC" on line 163

"PingFang TC" -> "PingFang SC"

#6 @ocean90
4 weeks ago

  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Review to 5.0
  • Owner set to laurelfulford
  • Status changed from new to reviewing
  • Summary changed from Again, error font-family style for Simplified Chinese (zh_CN). to Twenty Seventeen: Error font-family style for Simplified Chinese (zh_CN).

@vaishalipanchal
4 weeks ago

Updated patch.

#7 @vaishalipanchal
4 weeks ago

  • Keywords needs-refresh removed

#8 @laurelfulford
4 weeks ago

  • Keywords commit added; has-patch removed
  • Status changed from reviewing to accepted

Thank you, @ze3kr, for the report and review, and @vaishalipanchal for the patch!

I can confirm that this patch makes these styles in editor-blocks.css line up with what is used in style.css: [lang^="zh-"] now uses PingFang TC and STHeitiTC-Light, and [lang="zh-CN"] now uses PingFang SC and STHeitiSC-Light.

#9 @laurelfulford
4 weeks ago

  • Milestone changed from 5.0 to 5.0.1
  • Status changed from accepted to assigned

#10 @pento
11 days ago

  • Milestone changed from 5.0.1 to 5.0.2

#11 @laurelfulford
7 days ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44235:

Twenty Seventeen: Update font-family for Simplified Chinese (zh_CN).

Fix the font-family used for Simplified Chinese (zh_CN) in the block editor CSS.

Props vaishalipanchal, ze3kr.
Fixes #45408.

#12 @laurelfulford
7 days ago

  • Keywords has-patch fixed-5.0 added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening and marking fixed-5.0 so that this can be properly merged into trunk.

#13 @desrosj
5 days ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 44307:

Twenty Seventeen: Bug Fixes.

  • Remove unnecessary ol styles from editor. Twenty Seventeen was designed with bolded numbers for its ordered list styles. This was removed from the theme prior to launch, but it was left in the editor styles, so it needed to be removed there, too.
  • To improve accessibility, the cookies content checkbox in the comment form needed some visible indication when it’s in focus.
  • Twenty Seventeen’s editor styles contained an Internet Explorer 8 specific fix that stopped images from being scalable in the editor in other browsers. Since the editor no longer supports IE8, this fix can safely be removed.
  • Fix the font-family used for Simplified Chinese (zh_CN) in the block editor CSS.

Props mmaumio, edpittol, pratikthink, afercia, audrasjb, mihaivalentin, subrataemfluence, vaishalipanchal, ze3kr, laurelfulford.

Merges [44203-44205] and [44235] into trunk.

Fixes #44775, #44699, #39738, #45408.

Note: See TracTickets for help on using tickets.