Skip to content

Use locally generated ideographs

Use localIdeographFontFamily to specify CSS font-family fallbacks for CJK (Chinese, Japanese and Korean) map labels, after the style's fonts and before sans-serif.

import * as maplibregl from 'https://unpkg.com/maplibre-gl@6.21.0/dist/maplibre-gl.mjs';

const map = new maplibregl.Map({
    container: 'map',
    style: 'https://tiles.openfreemap.org/styles/bright',
    center: [120.3049, 31.4751],
    zoom: 12,
    localIdeographFontFamily: '"Apple LiSung", serif'
});
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Use locally generated ideographs</title>
    <meta property="og:description" content="Use localIdeographFontFamily to specify CSS font-family fallbacks for CJK (Chinese, Japanese and Korean) map labels, after the style's fonts and before sans-serif." />
    <meta property="og:category" content="Internationalization" />
    <meta property="og:created" content="2025-06-25" />
    <meta charset='utf-8'>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel='stylesheet' href='https://unpkg.com/maplibre-gl@6.21.0/dist/maplibre-gl.css' />

    <style>
        body { margin: 0; padding: 0; }
        html, body, #map { height: 100%; }
    </style>
</head>
<body>
<div id="map"></div>

<script type="module">
    import * as maplibregl from 'https://unpkg.com/maplibre-gl@6.21.0/dist/maplibre-gl.mjs';

    const map = new maplibregl.Map({
        container: 'map',
        style: 'https://tiles.openfreemap.org/styles/bright',
        center: [120.3049, 31.4751],
        zoom: 12,
        localIdeographFontFamily: '"Apple LiSung", serif'
    });
</script>
</body>
</html>