Fix reading number of HTMX metrics.
The length of the HHEA table can be incorrect, so it is better to read the number of metrics offset from beginning of table instead.
This commit is contained in:
		
							parent
							
								
									b39ec7af96
								
							
						
					
					
						commit
						32eace043b
					
				@ -1613,7 +1613,19 @@ var Font = (function FontClosure() {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        font.pos = (font.start ? font.start : 0) + header.offset;
 | 
					        font.pos = (font.start ? font.start : 0) + header.offset;
 | 
				
			||||||
        font.pos += header.length - 2;
 | 
					        font.pos += 4; // version
 | 
				
			||||||
 | 
					        font.pos += 2; // ascent
 | 
				
			||||||
 | 
					        font.pos += 2; // descent
 | 
				
			||||||
 | 
					        font.pos += 2; // linegap
 | 
				
			||||||
 | 
					        font.pos += 2; // adv_width_max
 | 
				
			||||||
 | 
					        font.pos += 2; // min_sb1
 | 
				
			||||||
 | 
					        font.pos += 2; // min_sb2
 | 
				
			||||||
 | 
					        font.pos += 2; // max_extent
 | 
				
			||||||
 | 
					        font.pos += 2; // caret_slope_rise
 | 
				
			||||||
 | 
					        font.pos += 2; // caret_slope_run
 | 
				
			||||||
 | 
					        font.pos += 2; // caret_offset
 | 
				
			||||||
 | 
					        font.pos += 8; // reserved
 | 
				
			||||||
 | 
					        font.pos += 2; // format
 | 
				
			||||||
        var numOfMetrics = font.getUint16();
 | 
					        var numOfMetrics = font.getUint16();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (numOfMetrics > numGlyphs) {
 | 
					        if (numOfMetrics > numGlyphs) {
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								test/pdfs/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								test/pdfs/.gitignore
									
									
									
									
										vendored
									
									
								
							@ -125,6 +125,7 @@
 | 
				
			|||||||
!issue6541.pdf
 | 
					!issue6541.pdf
 | 
				
			||||||
!issue2948.pdf
 | 
					!issue2948.pdf
 | 
				
			||||||
!issue6231_1.pdf
 | 
					!issue6231_1.pdf
 | 
				
			||||||
 | 
					!issue10402.pdf
 | 
				
			||||||
!issue7074_reduced.pdf
 | 
					!issue7074_reduced.pdf
 | 
				
			||||||
!issue6413.pdf
 | 
					!issue6413.pdf
 | 
				
			||||||
!issue4630.pdf
 | 
					!issue4630.pdf
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										
											BIN
										
									
								
								test/pdfs/issue10402.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								test/pdfs/issue10402.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -3429,6 +3429,12 @@
 | 
				
			|||||||
      "type": "eq",
 | 
					      "type": "eq",
 | 
				
			||||||
      "about": "True type font with encoding dict with no base encoding but with differences."
 | 
					      "about": "True type font with encoding dict with no base encoding but with differences."
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    {  "id": "issue10402",
 | 
				
			||||||
 | 
					       "file": "pdfs/issue10402.pdf",
 | 
				
			||||||
 | 
					       "md5": "7936bd34d7c0aebd0a864b5aa98aa1b4",
 | 
				
			||||||
 | 
					       "rounds": 1,
 | 
				
			||||||
 | 
					       "type": "eq"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
    {  "id": "issue3064-text",
 | 
					    {  "id": "issue3064-text",
 | 
				
			||||||
       "file": "pdfs/issue3064.pdf",
 | 
					       "file": "pdfs/issue3064.pdf",
 | 
				
			||||||
       "md5": "0307415b7d69b13acaf8bd4285d9544b",
 | 
					       "md5": "0307415b7d69b13acaf8bd4285d9544b",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user