npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yu-gothic-css

v1.0.1

Published

A CSS helper that defines a virtual Yu Gothic Weight Fixed font so Japanese text uses a more balanced weight on Windows.

Readme

CSS for Yu Gothic

Version NPM Downloads NPM Last Update Socket Badge Snyk Security

What is this?

This CSS defines a dedicated virtual font name "Yu Gothic Weight Fixed" to display the Windows version of Yu Gothic on websites with almost the same appropriate weight as other fonts. By importing this CSS and specifying "Yu Gothic Weight Fixed" in font-family, you can display Yu Gothic with almost the same weight as other fonts.

How to use

First, install the npm package yu-gothic-css.

pnpm add yu-gothic-css

Then, in a framework that supports global CSS imports (such as Astro), import this package for its side effects. The form import ... from "..." is not supported.

import "yu-gothic-css";

Alternatively, you can directly load it from a public CDN such as jsDelivr by adding a <link> tag.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/yu-gothic-css/index.css">

This defines the virtual font name "Yu Gothic Weight Fixed", so by specifying it in font-family, you can display Yu Gothic with almost the same weight as other fonts.

If you prefer Yu Gothic to Noto Sans CJK, place "Yu Gothic Weight Fixed" before Noto Sans CJK and Noto Sans JP in the font-family declaration.

/* Or [lang]:where(:lang(ja)) */
[lang|=ja i] {
  font-family: Hiragino Sans, Noto Sans CJK, Noto Sans CJK JP, Noto Sans JP, Yu Gothic Weight Fixed, Meiryo, sans-serif;
}

If you want to use CSS variables, define them as follows.

/* If you don't include [lang], the font won't switch correctly on pages with multiple languages */
:root, [lang] {
  font-family: var(--lang-specific-font-family, ""), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[lang|=ja i] {
  --lang-specific-font-family: Hiragino Sans, Noto Sans CJK, Noto Sans CJK JP, Noto Sans JP, Yu Gothic Weight Fixed, Meiryo;
}

Of course, you can place "Yu Gothic Weight Fixed" before Noto Sans CJK and Noto Sans JP if you prefer Yu Gothic to Noto Sans CJK:

[lang]:where(:lang(ja)) {
  --lang-specific-font-family: Hiragino Sans, Yu Gothic Weight Fixed, Noto Sans CJK, Noto Sans CJK JP, Noto Sans JP, Meiryo;
}

Wait, isn't Meiryo or Noto Sans JP (alone) good enough?

In fact, these fonts are only pre-installed on Japanese versions of Windows (as you might suspect). On non-Japanese versions of Windows, the only Japanese fonts that are pre-installed are Yu Gothic and Yu Gothic UI. Even Yu Mincho (serif version of Yu Gothic) is not included. On non-Japanese versions of Windows, when displaying Japanese pages on websites, Yu Gothic will be used, so if you also consider non-native Japanese viewers, you cannot avoid this Yu Gothic issue.

Chromium-based browsers have had a bug in the past where the lines of fonts were displayed excessively thin. Combined with the aforementioned characteristics of Yu Gothic, this has led to a poor reputation for Yu Gothic on websites, overshadowed by Meiryo and Noto Sans JP.

Yu Gothic has more features compared to Meiryo and Noto Sans JP. Features that are not available in Meiryo but are common with Noto Sans JP include the following:

  • Proportional spacing for kana and punctuation marks
  • Adjustment of spacing for consecutive quotes and brackets (In Chromium-based browsers (as of now), the spacing for brackets and punctuation marks differs between Meiryo and other fonts)
  • Italic for Japanese characters (The lack of support in Meiryo is intentional, but some browsers forcibly italicize them)

Features that are not available in Noto Sans JP but are unique to Yu Gothic include the following:

  • Kana glyphs further optimized for horizontal writing than the default
  • Ruby-specific kana glyphs
  • Proportional kana glyphs
  • Other Adobe Japan1-7 limited glyphs

Issues with Yu Gothic

Yu Gothic itself is a font that has received a certain level of evaluation in DTP, mainly for body text. However, the Windows version of Yu Gothic has several issues when used in browsers, Office, and other applications.

Not limited to the Windows version, Yu Gothic is actually thinner compared to other fonts than the value of font-weight or the suffix indicating the weight (Regular, Bold, etc.) would suggest.

For example, Yu Gothic Regular is thinner than the Regular of other common fonts (e.g. Segoe UI, Inter, and Noto Sans JP) and is only about the thickness of SemiLight (Segoe UI) or Light (most of the rest). To match the thickness of Regular in other fonts, you need to use Yu Gothic Medium.

Also, this is not limited to Yu Gothic, but the Bold weight included in Japanese fonts other than Noto Sans JP (Source Han Sans) and Meiryo is only about the thickness of SemiBold for Latin fonts like Segoe UI and Inter. Therefore, Yu Gothic lacks a bit of contrast between bold and regular compared to Noto Sans and Meiryo.

When you bold Yu Gothic Medium on Windows, it becomes a forcibly created bold through pseudo-bold processing, like MS Gothic. The bold created in this way, especially when printed, has blurred character outlines and looks unattractive.

If you want to use Yu Gothic Medium and Bold in Office, you need to take the very cumbersome step of changing the part you want to bold to regular Yu Gothic (Regular) and then pressing the bold button.

I am using a non-Japanese version of Windows but want to try Meiryo or Noto Sans JP

Corresponding Microsoft Docs page

  1. Open "System > Optional features" in Windows settings.
  2. Press the "Show features" button under "Show or edit optional features".
  3. A UAC window will appear, so exercise your system administrator privileges.
  4. Press the "Show available features" link above the search box.
  5. Enter a search term corresponding to "Japanese" in the search box, check the "Japanese Supplemental Fonts" that appears, and press the "Add" button below.