Limited availability
Experimental: ì´ ê¸°ë¥ì ì¤íì ì¸ ê¸°ë¥ì
ëë¤.
íë¡ëì
íê²½ìì ì¬ì©í기 ì ì ë¸ë¼ì°ì í¸íì± í를 주ì ê¹ê² íì¸íì¸ì.
ë³´ì 컨í ì¤í¸: ì´ ê¸°ë¥ì ì¼ë¶ ëë 모ë ì§ì ë¸ë¼ì°ì ì ë³´ì 컨í ì¤í¸ (HTTPS)ììë§ ì¬ì©í ì ììµëë¤.
window.queryLocalFonts()
ë©ìëë ë¡ì»¬ìì ì¬ì© ê°ë¥í í°í¸ íì´ì¤ë¥¼ ëíë´ë FontData
ê°ì²´ì ë°°ì´ì 충족íë Promise
를 ë°íí©ëë¤.
ì´ ë©ìë를 ì¬ì©í기 ìí´ì ì¬ì©ìë ë°ëì local-fonts
(Permissions API를 íµí ê¶í ìí) ì ê·¼ ê¶íì íì©í´ì¼ í©ëë¤. ëí, ì´ í¹ì±ì ì¬ì©ìì ìë²ì ì¤ì ë ê¶í ì ì±
ì ìíì¬ ì°¨ë¨ë ì ììµëë¤.
options
Optional
ì íì ì¸ ì¤ì íë¼ë¯¸í°ë¥¼ í¬í¨í©ëë¤. íì¬ë íëì ìì±ì´ ì ìëì´ ììµëë¤.
postscriptNames
Optional
í°í¸ PostScript ì´ë¦ì ë°°ì´ì ëë¤. ì´ ìì±ì´ ì¤ì ëì´ ìì¼ë©´ PostScript ì´ë¦ê³¼ 매ì¹ëë í°í¸ë¤ë§ ê²°ê³¼ì ëíëê² ë©ëë¤. ê·¸ë ì§ ìì¼ë©´ 모ë í°í¸ê° ê²°ê³¼ì ìíê² ë©ëë¤.
ë¡ì»¬ìì ì¬ì© ê°ë¥í í°í¸ íì´ì¤ë¥¼ ëíë´ë FontData
ê°ì²´ì ë°°ì´ì 충족íë Promise
를 ë°íí©ëë¤.
NotAllowedError
DOMException
ì¬ì©ìê° ì´ ë©ìëê° ì²ìì¼ë¡ í¸ì¶ë í ë¸ë¼ì°ì ì ê¶í ìì²ìì ì´ í¹ì±ì ì¬ì©í ê¶íì ê±°ë¶í ìíì ëë¤.
SecurityError
DOMException
ì´ ê¸°ë¥ì ì¬ì©ì´ ê¶í ì ì± ì ìí´ ì°¨ë¨ëìê±°ë, ë²í¼ í´ë¦ê³¼ ê°ì ì¬ì©ì ìí¸ìì©ì íµí´ í¸ì¶ëì§ ììê±°ë, íì¬ origin ì´ ëª¨í¸í ì¶ì²ì´ê¸° ë문ì ëë¤.
ì¤ìê° ë°ëª¨ë¥¼ ì¤ííë ¤ë©´ Font Select Demo를 íì¸íì¸ì.
í°í¸ ì´ê±°íìë ì¤ëí«ì ì¬ì© ê°ë¥í 모ë í°í¸ë¥¼ ì¡°ííê³ ë©íë°ì´í°ë¥¼ 기ë¡í©ëë¤. ì를 ë¤ì´ í°í¸ ì í ì ì´ë¥¼ ì±ì°ë ë°ì ì¬ì©í ì ììµëë¤.
async function logFontData() {
try {
const availableFonts = await window.queryLocalFonts();
for (const fontData of availableFonts) {
console.log(fontData.postscriptName);
console.log(fontData.fullName);
console.log(fontData.family);
console.log(fontData.style);
}
} catch (err) {
console.error(err.name, err.message);
}
}
ë°íë ê²°ê³¼ ì ì´í기
postscriptNames
기ë¥ì ì¬ì©íë©´ ë°íë í°í¸ ë°ì´í°ë¥¼ í°í¸ íì´ì¤ì í¹ì 리ì¤í¸ë¡ ì íí ì ììµëë¤.
async function returnSpecificFonts() {
const availableFonts = await window.queryLocalFonts({
postscriptNames: ["Verdana", "Verdana-Bold", "Verdana-Italic"],
});
return availableFonts;
}
ë®ì ë 벨ì ë°ì´í°ì ì ê·¼í기
blob()
ë©ìëë ë®ì ë 벨ì SFNT ë°ì´í°ì ì ê·¼í ì ìëë¡ í©ëë¤. SFNTë PostScript, TrueType, OpenType, Web Open Font Format(WOFF) ê³¼ ê°ì ë¤ë¥¸ í°í¸ íìì í¬í¨í ì ìë í°í¸ íì¼ íìì
ëë¤.
async function computeOutlineFormat() {
try {
const availableFonts = await window.queryLocalFonts({
postscriptNames: ["ComicSansMS"],
});
for (const fontData of availableFonts) {
// `blob()`ì ì í¨íê³ ìì í SFNT ëíë í°í¸ ë°ì´í°ë¥¼ í¬í¨íë
// Blobì ë°íí©ëë¤.
const sfnt = await fontData.blob();
// íìí ë°ì´í¸ë§ ìë¼ë
ëë¤. ì²ì 4ë°ì´í¸ë SFNT
// ë²ì ì ì ë³´ì
ëë¤.
// ëª
ì¸: https://learn.microsoft.com/ko/typography/opentype/spec/otff#organization-of-an-opentype-font
const sfntVersion = await sfnt.slice(0, 4).text();
let outlineFormat = "UNKNOWN";
switch (sfntVersion) {
case "\x00\x01\x00\x00":
case "true":
case "typ1":
outlineFormat = "truetype";
break;
case "OTTO":
outlineFormat = "cff";
break;
}
console.log("Outline format:", outlineFormat);
}
} catch (err) {
console.error(err.name, err.message);
}
}
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4