| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include <ctype.h> | 8 #include <ctype.h> |
| 9 | 9 |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 if (emSize == 1000) { | 279 if (emSize == 1000) { |
| 280 return scaled; | 280 return scaled; |
| 281 } else { | 281 } else { |
| 282 return SkScalarMulDiv(scaled, 1000, emSize); | 282 return SkScalarMulDiv(scaled, 1000, emSize); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 void setGlyphWidthAndBoundingBox(SkScalar width, SkIRect box, | 286 void setGlyphWidthAndBoundingBox(SkScalar width, SkIRect box, |
| 287 SkWStream* content) { | 287 SkWStream* content) { |
| 288 // Specify width and bounding box for the glyph. | 288 // Specify width and bounding box for the glyph. |
| 289 SkPDFScalar::Append(width, content); | 289 SkPDFUtils::AppendScalar(width, content); |
| 290 content->writeText(" 0 "); | 290 content->writeText(" 0 "); |
| 291 content->writeDecAsText(box.fLeft); | 291 content->writeDecAsText(box.fLeft); |
| 292 content->writeText(" "); | 292 content->writeText(" "); |
| 293 content->writeDecAsText(box.fTop); | 293 content->writeDecAsText(box.fTop); |
| 294 content->writeText(" "); | 294 content->writeText(" "); |
| 295 content->writeDecAsText(box.fRight); | 295 content->writeDecAsText(box.fRight); |
| 296 content->writeText(" "); | 296 content->writeText(" "); |
| 297 content->writeDecAsText(box.fBottom); | 297 content->writeDecAsText(box.fBottom); |
| 298 content->writeText(" d1\n"); | 298 content->writeText(" d1\n"); |
| 299 } | 299 } |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 } | 1418 } |
| 1419 if (existingFont != NULL) { | 1419 if (existingFont != NULL) { |
| 1420 return (existingFont->fFirstGlyphID <= searchGlyphID && | 1420 return (existingFont->fFirstGlyphID <= searchGlyphID && |
| 1421 searchGlyphID <= existingFont->fLastGlyphID) | 1421 searchGlyphID <= existingFont->fLastGlyphID) |
| 1422 ? SkPDFFont::kExact_Match | 1422 ? SkPDFFont::kExact_Match |
| 1423 : SkPDFFont::kRelated_Match; | 1423 : SkPDFFont::kRelated_Match; |
| 1424 } | 1424 } |
| 1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match | 1425 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match |
| 1426 : SkPDFFont::kRelated_Match; | 1426 : SkPDFFont::kRelated_Match; |
| 1427 } | 1427 } |
| OLD | NEW |