@@ -1402,21 +1402,14 @@ impl<'a> Face<'a> {
14021402 /// Returns `false` when OS/2 table is not present.
14031403 #[ inline]
14041404 pub fn is_regular ( & self ) -> bool {
1405- self . tables
1406- . os2
1407- . map ( |s| s. style ( ) == Style :: Normal )
1408- . unwrap_or ( false )
1405+ self . style ( ) == Style :: Normal
14091406 }
14101407
14111408 /// Checks that face is marked as *Italic*.
1412- ///
1413- /// Returns `false` when OS/2 table is not present.
14141409 #[ inline]
14151410 pub fn is_italic ( & self ) -> bool {
1416- self . tables
1417- . os2
1418- . map ( |s| s. style ( ) == Style :: Italic )
1419- . unwrap_or ( false )
1411+ // A face can have a Normal style and a non-zero italic angle, which also makes it italic.
1412+ self . style ( ) == Style :: Italic || self . italic_angle ( ) != 0.0
14201413 }
14211414
14221415 /// Checks that face is marked as *Bold*.
@@ -1432,10 +1425,7 @@ impl<'a> Face<'a> {
14321425 /// Returns `false` when OS/2 table is not present or when its version is < 4.
14331426 #[ inline]
14341427 pub fn is_oblique ( & self ) -> bool {
1435- self . tables
1436- . os2
1437- . map ( |s| s. style ( ) == Style :: Oblique )
1438- . unwrap_or ( false )
1428+ self . style ( ) == Style :: Oblique
14391429 }
14401430
14411431 /// Returns face style.
@@ -1490,10 +1480,13 @@ impl<'a> Face<'a> {
14901480
14911481 /// Returns face's italic angle.
14921482 ///
1493- /// Returns `None ` when `post` table is not present.
1483+ /// Returns `0.0 ` when `post` table is not present.
14941484 #[ inline]
1495- pub fn italic_angle ( & self ) -> Option < f32 > {
1496- self . tables . post . map ( |table| table. italic_angle )
1485+ pub fn italic_angle ( & self ) -> f32 {
1486+ self . tables
1487+ . post
1488+ . map ( |table| table. italic_angle )
1489+ . unwrap_or ( 0.0 )
14971490 }
14981491
14991492 // Read https://github.com/freetype/freetype/blob/49270c17011491227ec7bd3fb73ede4f674aa065/src/sfnt/sfobjs.c#L1279
0 commit comments