টাইপফেস
নির্বাচিত text-এ একটি টাইপফেস family প্রয়োগ করুন। পরিসর নির্বাচিত হলে কেবল সেটিই বদলায়; শুধু caret থাকলে বর্তমান অনুচ্ছেদের লেখায় লাগে। প্রকৃত font file ও font-family মান service CSS-এ নির্ধারিত।
ডিফল্ট family হলো sans, serif, mono, ও cursive। বিশেষ করে বাংলা বা অন্য বহুভাষী content থাকা service-এ কোন family কোন 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: 'bn' })
const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'bn' }
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 না দিলে সব default family ব্যবহৃত হয়। নথিতে কেবল values-এ থাকা মান অনুমোদিত।
CSS শৈলী
নথি কেবল family-র নাম রাখে এবং CSS font file বেছে নেয়। editor ও প্রকাশিত দৃশ্যের জন্য একই container-এ variable বদলান।
css
.nabi-content {
--nabi-font-serif: "Noto Serif", "Noto Serif KR", serif;
--nabi-font-mono: "JetBrains Mono", monospace;
}web font ব্যবহার করলে আগে সেই font file লোড করুন। অনেক ভাষায় cursive-এর ভালো coverage থাকে না, তাই service যে প্রকৃত font ব্যবহার করবে সেটি বেছে নেওয়ার পরই দেওয়া ভালো।