| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 namespace blink { | 67 namespace blink { |
| 68 | 68 |
| 69 const NSFontTraitMask SYNTHESIZED_FONT_TRAITS = | 69 const NSFontTraitMask SYNTHESIZED_FONT_TRAITS = |
| 70 (NSBoldFontMask | NSItalicFontMask); | 70 (NSBoldFontMask | NSItalicFontMask); |
| 71 | 71 |
| 72 const NSFontTraitMask IMPORTANT_FONT_TRAITS = | 72 const NSFontTraitMask IMPORTANT_FONT_TRAITS = |
| 73 (NSCompressedFontMask | NSCondensedFontMask | NSExpandedFontMask | | 73 (NSCompressedFontMask | NSCondensedFontMask | NSExpandedFontMask | |
| 74 NSItalicFontMask | | 74 NSItalicFontMask | NSNarrowFontMask | NSPosterFontMask | |
| 75 NSNarrowFontMask | | |
| 76 NSPosterFontMask | | |
| 77 NSSmallCapsFontMask); | 75 NSSmallCapsFontMask); |
| 78 | 76 |
| 79 static BOOL AcceptableChoice(NSFontTraitMask desired_traits, | 77 static BOOL AcceptableChoice(NSFontTraitMask desired_traits, |
| 80 NSFontTraitMask candidate_traits) { | 78 NSFontTraitMask candidate_traits) { |
| 81 desired_traits &= ~SYNTHESIZED_FONT_TRAITS; | 79 desired_traits &= ~SYNTHESIZED_FONT_TRAITS; |
| 82 return (candidate_traits & desired_traits) == desired_traits; | 80 return (candidate_traits & desired_traits) == desired_traits; |
| 83 } | 81 } |
| 84 | 82 |
| 85 static BOOL BetterChoice(NSFontTraitMask desired_traits, | 83 static BOOL BetterChoice(NSFontTraitMask desired_traits, |
| 86 int desired_weight, | 84 int desired_weight, |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 6, // FontWeight500 | 309 6, // FontWeight500 |
| 312 8, // FontWeight600 | 310 8, // FontWeight600 |
| 313 9, // FontWeight700 | 311 9, // FontWeight700 |
| 314 10, // FontWeight800 | 312 10, // FontWeight800 |
| 315 12, // FontWeight900 | 313 12, // FontWeight900 |
| 316 }; | 314 }; |
| 317 return app_kit_font_weights[font_weight]; | 315 return app_kit_font_weights[font_weight]; |
| 318 } | 316 } |
| 319 | 317 |
| 320 } // namespace blink | 318 } // namespace blink |
| OLD | NEW |