@@ -1387,11 +1387,11 @@ function get_system_fonts(METRIC) {
1387
1387
// 1802957: FF109+: -moz no longer applied but keep for regression testing
1388
1388
// add bogus '-default-font' to check they are falling back to actual default
1389
1389
let oList = {
1390
- 'moz_fonts ' : [
1390
+ 'fonts_moz ' : [
1391
1391
'-default-font' , '-moz-bullet-font' , '-moz-button' , '-moz-button-group' , '-moz-desktop' , '-moz-dialog' , '-moz-document' ,
1392
1392
'-moz-field' , '-moz-info' , '-moz-list' , '-moz-message-bar' , '-moz-pull-down-menu' , '-moz-window' , '-moz-workspace' ,
1393
1393
] ,
1394
- 'system_fonts ' : [ 'caption' , 'icon' , 'menu' , 'message-box' , 'small-caption' , 'status-bar' ]
1394
+ 'fonts_system ' : [ 'caption' , 'icon' , 'menu' , 'message-box' , 'small-caption' , 'status-bar' ]
1395
1395
}
1396
1396
let aProps = [ 'font-size' , 'font-style' , 'font-weight' , 'font-family' ]
1397
1397
let hash , btn = '' , data = { } , notation = 'moz_fonts' == METRIC ? default_red : rfp_red
@@ -1418,7 +1418,7 @@ function get_system_fonts(METRIC) {
1418
1418
for ( const k of Object . keys ( tmpdata ) . sort ( ) ) { data [ k ] = tmpdata [ k ] ; count += tmpdata [ k ] . length }
1419
1419
hash = mini ( data )
1420
1420
// moz: defaults since at least 115 on win/linux: assume android/mac the same: i.e switch to generic font-families
1421
- if ( 'moz_fonts ' == METRIC ) {
1421
+ if ( 'fonts_moz ' == METRIC ) {
1422
1422
if ( 'windows' == isOS || 'mac' == isOS || 'linux' == isOS ) {
1423
1423
if ( 'fe778289' == hash ) { notation = default_green } // 16px normal 400 serif
1424
1424
} else if ( 'android' == isOS ) {
@@ -1447,6 +1447,7 @@ function get_system_fonts(METRIC) {
1447
1447
if ( '7e83ef35' == hash ) { notation = rfp_green } // 12px normal 400 Roboto
1448
1448
}
1449
1449
}
1450
+ if ( isSmart ) { count = ( count + '' ) . padStart ( 2 , ' ' ) } // aesthetics: align the last three "font" health metrics
1450
1451
btn = addButton ( 12 , METRIC , Object . keys ( data ) . length + '/' + count )
1451
1452
} catch ( e ) {
1452
1453
hash = e ; data = zErrLog
@@ -1526,8 +1527,19 @@ function get_widget_fonts(METRIC) {
1526
1527
1527
1528
function get_unicode ( ) {
1528
1529
/* https://www.bamsoftware.com/talks/fc15-fontfp/fontfp.html#demo */
1529
- // FF86+: 1676966: gfx.font_rendering.fallback.async
1530
- // set chars directly in HTML to force fallback ASAP
1530
+ /* NOTES
1531
+ FF86+: 1676966: gfx.font_rendering.fallback.async
1532
+ - set chars directly in HTML to force fallback ASAP
1533
+ FF131+ nightly: 1900175 + 1403931 ride the train
1534
+ - Enable USER_RESTRICTED for content processes on Nightly
1535
+ - security.sandbox.content.level > 7
1536
+ - this affected (FF win11 at least) clientrect/offset + actualBounding
1537
+ - 0x3095 + 0x532D (2 CJK chars)
1538
+ - almost always both in every style except cursive never affected
1539
+ - only changed in http(s), file:// not affected
1540
+ - so reminder that generally we should always be using https for final testing/analysis
1541
+ */
1542
+
1531
1543
let t0 = nowFn ( )
1532
1544
let styles = [ 'cursive' , 'monospace' , 'sans-serif' , 'serif' , 'system-ui' ] // system-ui = FF92+
1533
1545
// don't use 'none': this is default style + font per style for each language
@@ -1648,16 +1660,20 @@ function get_unicode() {
1648
1660
let div = dom . ugDiv , span = dom . ugSpan , slot = dom . ugSlot ,
1649
1661
canvas = dom . ugCanvas , ctx = canvas . getContext ( '2d' )
1650
1662
let rangeH , rangeW , wType , hType , width , height
1651
- // each char
1652
- fntCodes . forEach ( function ( code ) {
1653
- let codeString = String . fromCodePoint ( code )
1654
- slot . textContent = codeString // set once
1655
- let isFirst = code == fntCodes [ 0 ]
1656
- // each style
1657
- styles . forEach ( function ( stylename ) {
1658
- slot . style . fontFamily = stylename
1663
+
1664
+ // each style
1665
+ styles . forEach ( function ( stylename ) {
1666
+ slot . style . fontFamily = stylename
1667
+ let isFirst = stylename == styles [ 0 ]
1668
+ // each code
1669
+ fntCodes . forEach ( function ( code ) {
1670
+ let codeString = String . fromCodePoint ( code )
1671
+ slot . textContent = codeString // set once
1672
+ //slot.style.fontFamily = stylename
1673
+
1659
1674
// only typecheck once: first char on first style
1660
- let isTypeCheck = ( isFirst && stylename == styles [ 0 ] )
1675
+ let isFirstCode = code == fntCodes [ 0 ]
1676
+ let isTypeCheck = ( isFirst && isFirstCode )
1661
1677
// offset: span width, div height
1662
1678
// offset is just purely for info purposes: redundant with clientrect
1663
1679
if ( isOffset ) {
@@ -1726,7 +1742,7 @@ function get_unicode() {
1726
1742
if ( oTM [ k ] [ 'proceed' ] ) {
1727
1743
let prefix = k == 'width' ? 'glyphs_' : ''
1728
1744
try {
1729
- let isOnce = oTM [ k ] [ 'all' ] == false && isFirst
1745
+ let isOnce = oTM [ k ] [ 'all' ] == false && isFirstCode
1730
1746
if ( oTM [ k ] [ 'all' ] || isOnce ) {
1731
1747
let measure = tm [ k ]
1732
1748
if ( isTypeCheck ) {
@@ -1789,9 +1805,9 @@ const outputFonts = () => new Promise(resolve => {
1789
1805
get_document_fonts ( 'document_fonts' ) , // sets fntDocEnabled
1790
1806
get_script_defaults ( 'script_defaults' ) ,
1791
1807
get_fonts ( 'font_sizes' ) , // uses fntDocEnabled
1792
- get_system_fonts ( 'moz_fonts ' ) ,
1793
- get_system_fonts ( 'system_fonts ' ) ,
1794
- get_widget_fonts ( 'widget_fonts ' ) ,
1808
+ get_system_fonts ( 'fonts_moz ' ) ,
1809
+ get_system_fonts ( 'fonts_system ' ) ,
1810
+ get_widget_fonts ( 'fonts_widget ' ) ,
1795
1811
get_formats ( ) ,
1796
1812
get_woff2 ( 'woff2' ) ,
1797
1813
get_graphite ( 'graphite' ) , // uses fntDocEnabled
0 commit comments