Skip to content

pantoken-root / plugins/pantoken/logos/src / getLogoMeta

함수: getLogoMeta() ​

getLogoMeta(product, layout?, colorMode?, lang?): LogoMeta | undefined

베타

로고의 메타데이터를 가져옵니다. 여기에는 래스터화된 PNG의 width/height가 포함됩니다 — 예: dist/<name>.png 경로를 생성해야 하는 컨슈머(예: @pantoken/cdn를 통해)나 SVG를 파싱하지 않고 <img>의 크기를 지정해야 하는 경우를 위해 유용합니다.

매개변수 ​

product ​

Product

제품.

layout? ​

LogoLayout = "horizontal"

레이아웃(기본값 "horizontal").

colorMode? ​

LogoColorMode = "full-color"

색상 처리(기본값 "full-color").

lang? ​

LogoLang

번역된 변형을 원할 경우 지역화된 워드마크의 언어.

반환값 ​

LogoMeta | undefined

SVG 문자열, 또는 해당 조합이 존재하지 않으면 undefined.

예제 ​

Read a logo's aspect ratio

ts
import { getLogoMeta } from "@pantoken/plugin-logos";

const meta = getLogoMeta("canvas", "horizontal", "color");
meta && meta.width / meta.height; // the logo's real aspect ratio