Pretendard Documentation

repository·main·Indexed 25 days ago

https://github.com/orioncactus/pretendard

A Neo-grotesque typeface designed for cross-platform applications and multilingual typography, optimized for legibility in Korean and other environments. Based on Inter, Source Han Sans, and M PLUS 1p. Includes guides for integration in Flutter, React Native, and web environments, as well as specialized versions including Pretendard GOV, Pretendard JP, and Pretendard Std.

Tokens
4.5K
Snippets
18
Records
45
Agent score
86%

What's inside Pretendard

  1. Configure custom fonts in React Native

    main

    To use Pretendard fonts in a React Native project, you must register the font directory in a react-native.config.js file at the project root. This allows the assets to be linked to the Android and iOS native projects.

    1. Create or update react-native.config.js in your project root.
    2. Add the path to your font assets under the assets key.
    3. Run the linking command to integrate the fonts into the native platforms.
    module.exports = {
      assets: ['./assets/fonts'],
    };
  2. Set up Pretendard font in Flutter

    main

    To use Pretendard in a Flutter project, follow these steps:

    1. Organize Font Assets: Place the .otf font files in a fonts/ directory within your project root.
    2. Configure pubspec.yaml: Register the font family and map each weight to its corresponding asset file.
    3. Apply the Font: Use the fontFamily: 'Pretendard' property in a TextStyle or set it globally in your ThemeData.
    flutter:
      fonts:
        - family: Pretendard
          fonts:
            - asset: fonts/Pretendard-Black.otf
              weight: 900
            - asset: fonts/Pretendard-ExtraBold.otf
              weight: 800
            - asset: fonts/Pretendard-Bold.otf
              weight: 700
            - asset: fonts/Pretendard-SemiBold.otf
              weight: 600
            - asset: fonts/Pretendard-Medium.otf
              weight: 500
            - asset: fonts/Pretendard-Regular.otf
              weight: 400
            - asset: fonts/Pretendard-Light.otf
              weight: 300
            - asset: fonts/Pretendard-Light.otf
              weight: 200
            - asset: fonts/Pretendard-Thin.otf
              weight: 100
  3. Install Pretendard Std as a System Font

    main

    You can install Pretendard Std locally on your machine to use it as a system font.

    macOS (via Homebrew): Requires the homebrew/cask-fonts tap.

    NixOS: Add pretendard-std to your fonts.packages configuration.

    # macOS
    brew tap homebrew/cask-fonts
    brew install font-pretendard-std
    # NixOS
    { 
      fonts.packages = with pkgs; [ 
        pretendard-std 
      ]; 
    }