टाइपफ़ेस

चुने हुए पाठ पर टाइपफ़ेस श्रेणी लागू करता है। दायरा चुना हो तो केवल वही बदलता है; केवल caret हो तो मौजूदा अनुच्छेद के पाठ पर लागू होता है। वास्तविक font files और font-family सेवा की CSS तय करती है।

मूल श्रेणियाँ sans, serif, mono, cursive हैं। कई लिपियों वाली सेवा में हर श्रेणी से जुड़ा वास्तविक font स्पष्ट रूप से तय करना बेहतर है।

पंख
डिफ़ॉल्ट फ़ॉन्टऊँचाई
HTMLसंपादक लोड हो रहा है…
JSONnabi-treeसंपादक लोड हो रहा है…
इंस्टॉल
npm install nabi-note
कोड
import {
  createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
  mountHints, watchSettle, typefaceWing, fontSizeWing, dropCapWing,
  mountViewTools,
} from 'nabi-note'

const selected = [
  typefaceWing,
  fontSizeWing,
  dropCapWing,
]
const { nabi, registry } = createNabiWith(selected)

const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!

// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale: 'hi' })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'hi' }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })

// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))
ts
const selected = wings().use('tf', {
  values: ['sans', 'serif', 'mono'],
}).build()

values न देने पर सभी मूल श्रेणियाँ उपयोग होती हैं। दस्तावेज़ में केवल values में रखे मान अनुमत हैं।

CSS शैलियाँ

दस्तावेज़ में केवल श्रेणी का नाम सहेजा जाता है; font file CSS तय करती है। संपादक और प्रकाशित पृष्ठ के समान container में variables बदलें।

css
.nabi-content {
  --nabi-font-serif: "Noto Serif Devanagari", serif;
  --nabi-font-mono: "JetBrains Mono", monospace;
}

web font इस्तेमाल करें तो उसकी file भी पहले लोड करें। cursive में देवनागरी समर्थित font अक्सर नहीं मिलता, इसलिए सेवा में सचमुच उपयोग होने वाला font तय करने के बाद ही यह विकल्प देना बेहतर है।