PageSourceSearch

https://gieni.com/assets/QaFonts-CbGBKTK4.js

js gieni.com collected 2026-10-04 02:23:23 UTC 12,429 bytes, 1 lines download raw bytes

1import{j as e}from"./motion-9KGlaujz.js";import{r as n}from"./vendor-K42mtkE4.js";import{k as M,l as A,p as O,P as B,m as U,o as W,q as F,H as q,B as z}from"./index-Ap8HxMJ9.js";import{B as D,C as k}from"./badge-DOla4XxT.js";import{u as G}from"./index-CqGTJv0F.js";import{L as Q}from"./label-D7NiSrcy.js";import"./charts-B9EyGmOc.js";var S="Switch",[V,de]=M(S),[X,K]=V(S),P=n.forwardRef((s,o)=>{const{__scopeSwitch:r,name:m,checked:a,defaultChecked:j,required:d,disabled:h,value:x="on",onCheckedChange:v,form:f,...w}=s,[g,c]=n.useState(null),b=A(o,p=>c(p)),t=n.useRef(!1),l=g?f||!!g.closest("form"):!0,[i,u]=O({prop:a,defaultProp:j??!1,onChange:v,caller:S});return e.jsxs(X,{scope:r,checked:i,disabled:h,children:[e.jsx(B.button,{type:"button",role:"switch","aria-checked":i,"aria-required":d,"data-state":I(i),"data-disabled":h?"":void 0,disabled:h,value:x,...w,ref:b,onClick:U(s.onClick,p=>{u(y=>!y),l&&(t.current=p.isPropagationStopped(),t.current||p.stopPropagation())})}),l&&e.jsx(_,{control:g,bubbles:!t.current,name:m,value:x,checked:i,required:d,disabled:h,form:f,style:{transform:"translateX(-100%)"}})]})});P.displayName=S;var L="SwitchThumb",T=n.forwardRef((s,o)=>{const{__scopeSwitch:r,...m}=s,a=K(L,r);return e.jsx(B.span,{"data-state":I(a.checked),"data-disabled":a.disabled?"":void 0,...m,ref:o})});T.displayName=L;var Y="SwitchBubbleInput",_=n.forwardRef(({__scopeSwitch:s,control:o,checked:r,bubbles:m=!0,...a},j)=>{const d=n.useRef(null),h=A(d,j),x=G(r),v=W(o);return n.useEffect(()=>{const f=d.current;if(!f)return;const w=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(w,"checked").set;if(x!==r&&c){const b=new Event("click",{bubbles:m});c.call(f,r),f.dispatchEvent(b)}},[x,r,m]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:h,style:{...a.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=Y;function I(s){return s?"checked":"unchecked"}var H=P,J=T;const $=n.forwardRef(({className:s,...o},r)=>e.jsx(H,{className:F("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",s),...o,ref:r,children:e.jsx(J,{className:F("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$.displayName=H.displayName;const Z=[{family:"Figtree",weight:400,usedFor:"Body default (--font-body)"},{family:"Figtree",weight:500,usedFor:"font-medium (buttons, nav)"},{family:"Figtree",weight:600,usedFor:"font-semibold (section labels)"},{family:"Figtree",weight:700,usedFor:"font-bold .font-display headings"},{family:"Rufina",weight:400,usedFor:".font-serif headings (default)"},{family:"Rufina",weight:700,usedFor:"font-bold .font-serif headings"}],ee="The decision and action layer for Manufacturing 0123";function te(s,o){const r=document.fonts,m=r?r.check(`${o} 16px "${s}"`):!1,a=document.createElement("span");a.textContent=ee,a.style.position="absolute",a.style.visibility="hidden",a.style.whiteSpace="nowrap",a.style.fontSize="32px",a.style.fontWeight=String(o),document.body.appendChild(a),a.style.fontFamily="monospace";const j=a.getBoundingClientRect().width;a.style.fontFamily=`"${s}", monospace`;const d=a.getBoundingClientRect().width;document.body.removeChild(a);const h=Math.abs(d-j)>=.5;return{setCheck:m,rendered:h}}function se(){return Z.map(s=>{const o=te(s.family,s.weight);return{...s,...o,loaded:o.setCheck&&o.rendered}})}const R="gieni:qa:fonts:autorun",E="gieni:qa:fonts";function me(){const[s,o]=n.useState([]),[r,m]=n.useState("(unknown)"),[a,j]=n.useState({h1:"",h2:"",body:""}),[d,h]=n.useState(!1),[x,v]=n.useState([]),f=n.useRef(null),w=n.useRef(null),g=n.useRef(null),c=n.useCallback((t="manual",l)=>{const i=document.fonts;m((i==null?void 0:i.status)??"(no document.fonts API)");const u=se();o(u),j({h1:f.current?getComputedStyle(f.current).fontFamily:"",h2:w.current?getComputedStyle(w.current).fontFamily:"",body:g.current?getComputedStyle(g.current).fontFamily:""});const p=u.length>0&&u.every(y=>y.loaded);v(y=>[{at:new Date().toISOString(),path:l??window.location.pathname,trigger:t,pass:p},...y].slice(0,10))},[]);n.useEffect(()=>{var l;c("initial");const t=(l=document.fonts)==null?void 0:l.ready;t==null||t.then(()=>c("fonts.ready")).catch(()=>{})},[c]),n.useEffect(()=>{try{h(localStorage.getItem(R)==="1")}catch{}},[]),n.useEffect(()=>{try{localStorage.setItem(R,d?"1":"0")}catch{}if(!d)return;const t=()=>c("popstate",window.location.pathname),l=()=>c("hashchange",window.location.pathname),i=()=>{document.visibilityState==="visible"&&c("visibilitychange",window.location.pathname)};window.addEventListener("popstate",t),window.addEventListener("hashchange",l),document.addEventListener("visibilitychange",i
1);let u=null;return typeof BroadcastChannel<"u"&&(u=new BroadcastChannel(E),u.onmessage=p=>{var y;((y=p.data)==null?void 0:y.type)==="route"&&typeof p.data.path=="string"&&c("broadcast",p.data.path)}),()=>{window.removeEventListener("popstate",t),window.removeEventListener("hashchange",l),document.removeEventListener("visibilitychange",i),u==null||u.close()}},[d,c]);const b=n.useMemo(()=>{const t=s.length>0&&s.every(i=>i.loaded),l=s.filter(i=>!i.loaded).length;return{pass:t,allLoaded:t,failedCount:l}},[s]);return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(q,{children:[e.jsx("title",{children:"Font QA, Internal Use, Gieni"}),e.jsx("meta",{name:"robots",content:"noindex,nofollow"})]}),e.jsxs("main",{className:"max-w-4xl mx-auto px-6 py-16",children:[e.jsxs("div",{className:"mb-10 flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(D,{variant:"secondary",className:"mb-4",children:"Internal QA, not indexed"}),e.jsx("h1",{ref:f,className:"font-serif text-4xl md:text-5xl mb-3",children:"Font load verification"}),e.jsx("p",{ref:g,className:"text-muted-foreground",children:"Verifies the exact heading and body weights used across the UI: Figtree 400/500/600/700 and Rufina 400/700. Each row is checked twice, via FontFaceSet and via width-comparison rendering."})]}),e.jsxs("div",{className:"flex flex-col items-end gap-3 shrink-0",children:[e.jsx(z,{variant:"outline",size:"sm",onClick:()=>c("manual"),children:"Re-run"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{id:"autorun",checked:d,onCheckedChange:t=>h(!!t)}),e.jsx(Q,{htmlFor:"autorun",className:"text-xs cursor-pointer",children:"Run on route change"})]})]})]}),d&&e.jsxs(k,{className:"p-4 mb-6 bg-muted/30",children:[e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:["Auto-run is on. The verifier re-runs on browser back/forward, hash changes, when this tab regains focus, and when any other tab broadcasts a route change on the"," ",e.jsx("code",{className:"font-mono",children:E})," channel. Open the app in another tab; navigate around; return here to see the latest result and history."]}),x.length>0&&e.jsxs("div",{className:"mt-3 border-t border-border pt-3",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-2",children:"Recent runs"}),e.jsx("ul",{className:"space-y-1 text-xs font-mono",children:x.map((t,l)=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(N,{ok:t.pass}),e.jsx("span",{className:"text-muted-foreground",children:new Date(t.at).toLocaleTimeString()}),e.jsxs("span",{className:"text-muted-foreground/70",children:["[",t.trigger,"]"]}),e.jsx("span",{className:"truncate",children:t.path})]},`${t.at}-${l}`))})]})]}),e.jsxs(k,{className:"p-5 mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(N,{ok:b.pass}),e.jsx("h2",{ref:w,className:"font-serif text-xl",children:"Summary"})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["document.fonts.status:"," ",e.jsx("code",{className:"font-mono text-xs",children:r})]}),e.jsxs("ul",{className:"mt-3 text-sm space-y-1",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(N,{ok:b.allLoaded}),"All declared faces loaded (",s.filter(t=>t.loaded).length,"/",s.length,")"]}),b.failedCount>0&&e.jsxs("li",{className:"text-red-600 dark:text-red-400 ml-4",children:[b.failedCount," face(s) failed: see table below."]})]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Per-weight load status"}),e.jsx(k,{className:"p-0 overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/40 text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left font-medium px-4 py-2",children:"Family"}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:"Weight"}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:"Used for"}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:"FontFaceSet"}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:"Rendered"}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:"Sample"})]})}),e.jsx("tbody",{children:s.map(t=>e.jsxs("tr",{className:"border-t border-border align-middle",children:[e.jsx("td",{className:"px-4 py-2 font-mono",children:t.family}),e.jsx("td",{className:"px-4 py-2 font-mono",children:t.weight}),e.jsx("td",{className:"px-4 py-2 text-xs text-muted-foreground",children:t.usedFor}),e.jsx("td",{className:"px-4 py-2",children:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(N,{ok:t.setCheck}),t.setCheck?"ready":"missing"]})}),e.jsx("td",{className:"px-4 py-2",children:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(N,{ok:t.rendered}),t.rendered?"applied":"fallback"]})}),e.jsx("td",{className:"px-4 py-2 text-base",style:{fontFamily:`"${t.family}", monospace`,fontWeight:t.weight},children:"Aa Gg 1234"})]},`${t.family}-${t.weight}`))})]})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2 leading-relaxed",children:[e.jsx("strong",{children:"FontFaceSet"})," uses"," ",e.jsx("code",{className:"font-mono",children:"document.fonts.check()"})," to confirm the browser registered an @font-face for that exact weight."," ",e.jsx("strong",{children:"Rendered"})," measures a sample string at that weight against a monospace fallback: if widths match, the browser silently substituted or synthesized the weight."]})]}),e.jsxs("section",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Computed font-family (this page)"}),e.jsxs(k,{className:"p-5 space-y-3 text-sm",children:[e.jsx(C,{label:"H1 (expects Rufina)",value:a.h1,expect:"Rufina"}),e.jsx(C,{label:"H2 (expects Rufina)",value:a.h2,expect:"Rufina"}),e.jsx(C,{label:"body paragraph (expects Figtree)",value:a.body,expect:"Figtree"})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-sm uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Visual reference"}),e.jsxs(k,{className:"p-6 space-y-4",children:[e.jsx("p",{className:"font-serif text-3xl",children:"Rufina serif heading sample, 400 + 700"}),e.jsx("p",{className:"font-serif text-3xl font-bold",children:"Rufina bold heading sample"}),e.jsx("p",{className:"text-base",children:"Figtree body sample at 400. Figtree should render here as a clean geometric humanist sans, distinct from system fallbacks like Helvetica or Arial."}),e.jsx("p",{className:"text-base font-semibold",children:"Figtree body sample at 600."})]})]})]})]})}function C({label:s,value:o,expect:r}){const m=o.toLowerCase().includes(r.toLowerCase());return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"pt-1",children:e.jsx(N,{ok:m})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-muted-foreground",children:s}),e.jsx("div",{className:"font-mono break-all",children:o||"(unavailable)"})]})]})}function N({ok:s}
1){return e.jsx("span",{"aria-hidden":!0,className:`inline-block w-2 h-2 rounded-full ${s?"bg-emerald-500":"bg-red-500"}`})}export{me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.