Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cf2hints.c

Issue 294353002: Fix warnings in android build, fix font rendering issue, fix issue 357588: wrong characters represe… (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Patch Set after rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /***************************************************************************/ 1 /***************************************************************************/
2 /* */ 2 /* */
3 /* cf2hints.c */ 3 /* cf2hints.c */
4 /* */ 4 /* */
5 /* Adobe's code for handling CFF hints (body). */ 5 /* Adobe's code for handling CFF hints (body). */
6 /* */ 6 /* */
7 /* Copyright 2007-2013 Adobe Systems Incorporated. */ 7 /* Copyright 2007-2013 Adobe Systems Incorporated. */
8 /* */ 8 /* */
9 /* This software, and all works of authorship, whether in source or */ 9 /* This software, and all works of authorship, whether in source or */
10 /* object code form as indicated by the copyright notice(s) included */ 10 /* object code form as indicated by the copyright notice(s) included */
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 /* construct offset points */ 1578 /* construct offset points */
1579 P0.x = glyphpath->currentCS.x + xOffset; 1579 P0.x = glyphpath->currentCS.x + xOffset;
1580 P0.y = glyphpath->currentCS.y + yOffset; 1580 P0.y = glyphpath->currentCS.y + yOffset;
1581 P1.x = x + xOffset; 1581 P1.x = x + xOffset;
1582 P1.y = y + yOffset; 1582 P1.y = y + yOffset;
1583 1583
1584 if ( glyphpath->moveIsPending ) 1584 if ( glyphpath->moveIsPending )
1585 { 1585 {
1586 /* emit offset 1st point as MoveTo */ 1586 /* emit offset 1st point as MoveTo */
1587 cf2_glyphpath_pushMove( glyphpath, P0 ); 1587 cf2_glyphpath_pushMove( glyphpath, P0 );
1588 if (glyphpath->callbacks && glyphpath->callbacks->error && *glyphpath- >callbacks->error) return;
1588 1589
1589 glyphpath->moveIsPending = FALSE; /* adjust state machine */ 1590 glyphpath->moveIsPending = FALSE; /* adjust state machine */
1590 glyphpath->pathIsOpen = TRUE; 1591 glyphpath->pathIsOpen = TRUE;
1591 1592
1592 glyphpath->offsetStart1 = P1; /* record second point */ 1593 glyphpath->offsetStart1 = P1; /* record second point */
1593 } 1594 }
1594 1595
1595 if ( glyphpath->elemIsQueued ) 1596 if ( glyphpath->elemIsQueued )
1596 { 1597 {
1597 FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ); 1598 FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) );
1598 1599
1599 cf2_glyphpath_pushPrevElem( glyphpath, 1600 cf2_glyphpath_pushPrevElem( glyphpath,
1600 &glyphpath->hintMap, 1601 &glyphpath->hintMap,
1601 &P0, 1602 &P0,
1602 P1, 1603 P1,
1603 FALSE ); 1604 FALSE );
1605 if (glyphpath->callbacks && glyphpath->callbacks->error && *glyphpath- >callbacks->error) return;
1604 } 1606 }
1605 1607
1606 /* queue the current element with offset points */ 1608 /* queue the current element with offset points */
1607 glyphpath->elemIsQueued = TRUE; 1609 glyphpath->elemIsQueued = TRUE;
1608 glyphpath->prevElemOp = CF2_PathOpLineTo; 1610 glyphpath->prevElemOp = CF2_PathOpLineTo;
1609 glyphpath->prevElemP0 = P0; 1611 glyphpath->prevElemP0 = P0;
1610 glyphpath->prevElemP1 = P1; 1612 glyphpath->prevElemP1 = P1;
1611 1613
1612 /* update current map */ 1614 /* update current map */
1613 if ( cf2_hintmask_isNew( glyphpath->hintMask ) ) 1615 if ( cf2_hintmask_isNew( glyphpath->hintMask ) )
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 /* note: preserve angle of final segment by using offset3 at both ends */ 1666 /* note: preserve angle of final segment by using offset3 at both ends */
1665 P2.x = x2 + xOffset3; 1667 P2.x = x2 + xOffset3;
1666 P2.y = y2 + yOffset3; 1668 P2.y = y2 + yOffset3;
1667 P3.x = x3 + xOffset3; 1669 P3.x = x3 + xOffset3;
1668 P3.y = y3 + yOffset3; 1670 P3.y = y3 + yOffset3;
1669 1671
1670 if ( glyphpath->moveIsPending ) 1672 if ( glyphpath->moveIsPending )
1671 { 1673 {
1672 /* emit offset 1st point as MoveTo */ 1674 /* emit offset 1st point as MoveTo */
1673 cf2_glyphpath_pushMove( glyphpath, P0 ); 1675 cf2_glyphpath_pushMove( glyphpath, P0 );
1676 if (glyphpath->callbacks && glyphpath->callbacks->error && *glyphpath- >callbacks->error) return;
1674 1677
1675 glyphpath->moveIsPending = FALSE; 1678 glyphpath->moveIsPending = FALSE;
1676 glyphpath->pathIsOpen = TRUE; 1679 glyphpath->pathIsOpen = TRUE;
1677 1680
1678 glyphpath->offsetStart1 = P1; /* record second point */ 1681 glyphpath->offsetStart1 = P1; /* record second point */
1679 } 1682 }
1680 1683
1681 if ( glyphpath->elemIsQueued ) 1684 if ( glyphpath->elemIsQueued )
1682 { 1685 {
1683 FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ); 1686 FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) );
1684 1687
1685 cf2_glyphpath_pushPrevElem( glyphpath, 1688 cf2_glyphpath_pushPrevElem( glyphpath,
1686 &glyphpath->hintMap, 1689 &glyphpath->hintMap,
1687 &P0, 1690 &P0,
1688 P1, 1691 P1,
1689 FALSE ); 1692 FALSE );
1693 if (glyphpath->callbacks && glyphpath->callbacks->error && *glyphpath- >callbacks->error) return;
1690 } 1694 }
1691 1695
1692 /* queue the current element with offset points */ 1696 /* queue the current element with offset points */
1693 glyphpath->elemIsQueued = TRUE; 1697 glyphpath->elemIsQueued = TRUE;
1694 glyphpath->prevElemOp = CF2_PathOpCubeTo; 1698 glyphpath->prevElemOp = CF2_PathOpCubeTo;
1695 glyphpath->prevElemP0 = P0; 1699 glyphpath->prevElemP0 = P0;
1696 glyphpath->prevElemP1 = P1; 1700 glyphpath->prevElemP1 = P1;
1697 glyphpath->prevElemP2 = P2; 1701 glyphpath->prevElemP2 = P2;
1698 glyphpath->prevElemP3 = P3; 1702 glyphpath->prevElemP3 = P3;
1699 1703
(...skipping 16 matching lines...) Expand all
1716 { 1720 {
1717 if ( glyphpath->pathIsOpen ) 1721 if ( glyphpath->pathIsOpen )
1718 { 1722 {
1719 FT_ASSERT( cf2_hintmap_isValid( &glyphpath->firstHintMap ) ); 1723 FT_ASSERT( cf2_hintmap_isValid( &glyphpath->firstHintMap ) );
1720 1724
1721 /* since we need to apply an offset to the implicit lineto, we make */ 1725 /* since we need to apply an offset to the implicit lineto, we make */
1722 /* it explicit here */ 1726 /* it explicit here */
1723 cf2_glyphpath_lineTo( glyphpath, 1727 cf2_glyphpath_lineTo( glyphpath,
1724 glyphpath->start.x, 1728 glyphpath->start.x,
1725 glyphpath->start.y ); 1729 glyphpath->start.y );
1730 if (glyphpath->callbacks && glyphpath->callbacks->error && *glyphpath- >callbacks->error) return;
1726 1731
1727 /* Draw previous element (the explicit LineTo we just created, */ 1732 /* Draw previous element (the explicit LineTo we just created, */
1728 /* above) and connect it to the start point, but with the offset we */ 1733 /* above) and connect it to the start point, but with the offset we */
1729 /* saved from the first element. */ 1734 /* saved from the first element. */
1730 /* Use the saved HintMap, too. */ 1735 /* Use the saved HintMap, too. */
1731 FT_ASSERT( glyphpath->elemIsQueued ); 1736 FT_ASSERT( glyphpath->elemIsQueued );
1732 1737
1733 cf2_glyphpath_pushPrevElem( glyphpath, 1738 cf2_glyphpath_pushPrevElem( glyphpath,
1734 &glyphpath->firstHintMap, 1739 &glyphpath->firstHintMap,
1735 &glyphpath->offsetStart0, 1740 &glyphpath->offsetStart0,
1736 glyphpath->offsetStart1, 1741 glyphpath->offsetStart1,
1737 TRUE ); 1742 TRUE );
1738 1743
1739 /* reset state machine */ 1744 /* reset state machine */
1740 glyphpath->moveIsPending = TRUE; 1745 glyphpath->moveIsPending = TRUE;
1741 glyphpath->pathIsOpen = FALSE; 1746 glyphpath->pathIsOpen = FALSE;
1742 glyphpath->elemIsQueued = FALSE; 1747 glyphpath->elemIsQueued = FALSE;
1743 } 1748 }
1744 } 1749 }
1745 1750
1746 1751
1747 /* END */ 1752 /* END */
OLDNEW
« no previous file with comments | « core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cf2ft.c ('k') | core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cf2intrp.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698