소스 검색

LibHTML: Fall back to the system default font if we can't find a font

Instead of crashing when we don't have some font the CSS wanted,
just go with Font::default_font().
Andreas Kling 5 년 전
부모
커밋
b587eb2f4d
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Libraries/LibHTML/CSS/StyleProperties.cpp

+ 2 - 1
Libraries/LibHTML/CSS/StyleProperties.cpp

@@ -81,7 +81,8 @@ void StyleProperties::load_font() const
 
 
     if (file_name.is_null()) {
     if (file_name.is_null()) {
         dbg() << "Failed to find a font for family " << font_family << " weight " << font_weight;
         dbg() << "Failed to find a font for family " << font_family << " weight " << font_weight;
-        ASSERT_NOT_REACHED();
+        m_font = Font::default_font();
+        return;
     }
     }
 
 
 #ifdef HTML_DEBUG
 #ifdef HTML_DEBUG