| @@ -133,12 +133,12 @@ | ||
| 133 | 133 | // A warm/probe is never scoped, so it downloads every declared font |
| 134 | 134 | // and keeps the shared cache complete. |
| 135 | 135 | $tracker = new UsageTracker(); |
| 136 | 136 | $profile = $this->force |
| 137 | - ? array( 'scope_out' => array(), 'above_fold' => array(), 'measured' => false ) | |
| 137 | + ? array( 'scope_out' => array(), 'fold_faces' => array(), 'measured' => false ) | |
| 138 | 138 | : $tracker->route_render_profile( $route ); |
| 139 | 139 | $scope_out = $profile['scope_out']; |
| 140 | - $above_fold = $profile['above_fold']; | |
| 140 | + $fold_faces = $profile['fold_faces']; | |
| 141 | 141 | $measured = ! empty( $profile['measured'] ); |
| 142 | 142 | |
| 143 | 143 | // 1. Detect + localise. The consolidator is transactional: it only |
| 144 | 144 | // rewrites the page when every font it needs is already hosted |
| @@ -158,9 +158,9 @@ | ||
| 158 | 158 | $buffer = $stripped['html']; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // 3. Inject preloads → consolidated stylesheet → metric fallbacks. |
| 162 | - $head = $this->build_head( $route, $device, $above_fold ); | |
| 162 | + $head = $this->build_head( $route, $device, $fold_faces ); | |
| 163 | 163 | |
| 164 | 164 | if ( '' !== $head ) { |
| 165 | 165 | $buffer = $this->html->before_head_close( $buffer, $head ); |
| 166 | 166 | } |
| @@ -242,18 +242,18 @@ | ||
| 242 | 242 | * stylesheet, then the metric-matched fallback faces. |
| 243 | 243 | * |
| 244 | 244 | * @param string $route Canonical route for this page. |
| 245 | 245 | * @param string $device Device ('mobile'|'desktop'). |
| 246 | - * @param array<string,bool> $above_fold Lowercased families above the fold on this route. | |
| 246 | + * @param array<string,array<string,bool>> $fold_faces Above-the-fold faces per family rendered on this route. | |
| 247 | 247 | * @return string |
| 248 | 248 | */ |
| 249 | - private function build_head( string $route = '', string $device = 'any', array $above_fold = array() ): string { | |
| 249 | + private function build_head( string $route = '', string $device = 'any', array $fold_faces = array() ): string { | |
| 250 | 250 | $out = ''; |
| 251 | 251 | $stylesheet = Consolidator::stylesheet_url(); |
| 252 | 252 | |
| 253 | 253 | // Preloads — above the stylesheet, deduped inside SmartPreload, scoped |
| 254 | 254 | // to the fonts actually emitted on this page (Consolidator::touched). |
| 255 | - $out .= ( new SmartPreload() )->build( $route, $device, $this->present_families(), $above_fold ); | |
| 255 | + $out .= ( new SmartPreload() )->build( $route, $device, $this->present_families(), $fold_faces ); | |
| 256 | 256 | |
| 257 | 257 | // The single consolidated stylesheet — either inlined (non-render- |
| 258 | 258 | // blocking: no extra request) or as a normal <link>. |
| 259 | 259 | if ( '' !== $stylesheet ) { |