| 1666 | // in the generation and playing of the picture. |
| 1667 | |
| 1668 | void MetaInit() |
| 1669 | { |
| 1670 | int i, j, k; |
| 1671 | |
| 1672 | gi.pwMetaCur = (word *)gi.bm; |
| 1673 | // Placeable Metaheader |
| 1674 | MetaLong(0x9ac6cdd7); |
| 1675 | MetaWord(0); // Not used |
| 1676 | MetaWord(0); MetaWord(0); |
| 1677 | MetaWord(gs.xWin); MetaWord(gs.yWin); |
| 1678 | MetaWord(gs.xWin/6); // Units per inch |
| 1679 | MetaLong(0L); // Not used |
| 1680 | MetaWord(0x9ac6 ^ 0xcdd7 ^ gs.xWin ^ gs.yWin ^ gs.xWin/6); // Checksum |
| 1681 | // Metaheader |
| 1682 | MetaWord(1); // Metafile type |
| 1683 | MetaWord(9); // Size of header in words |
| 1684 | MetaWord(0x300); // Windows version |
| 1685 | MetaLong(0L); // Size of entire metafile in words |
| 1686 | MetaWord(16*5+1+(gs.nFontAll>0)*(cFont-1)); // Number of objects in metafile |
| 1687 | MetaLong(17L); // Size of largest record in words |
| 1688 | MetaWord(0); // Not used |
| 1689 | // Setup |
| 1690 | MetaEscape(17); |
| 1691 | MetaLong(LFromBB('A', 's', 't', 'r')); // "Astr" |
| 1692 | MetaWord(4); // Creator |
| 1693 | MetaLong(14L); // Bytes in string |
| 1694 | MetaLong(LFromBB('A', 's', 't', 'r')); // "Astr" |
| 1695 | MetaLong(LFromBB('o', 'l', 'o', 'g')); // "olog" |
| 1696 | MetaLong(LFromBB(' ', szVerCore[0], '.', szVerCore[1])); // Version |
| 1697 | MetaWord(WFromBB(szVerCore[2], 0)); // Version part 2 |
| 1698 | MetaSaveDc(); |
| 1699 | MetaWindowOrg(0, 0); |
| 1700 | MetaWindowExt(gs.xWin, gs.yWin); |
| 1701 | MetaBkMode(1 /* Transparent */); |
| 1702 | // Colors |
| 1703 | for (j = 1; j <= 4; j++) |
| 1704 | for (i = 0; i < 16; i++) { |
| 1705 | k = (j <= 1 ? gi.nPenWid * (1 + gs.fThick) : 0); |
| 1706 | k += gs.nThickAdjust; |
| 1707 | if (k < 0) |
| 1708 | k = 0; |
| 1709 | MetaCreatePen(j <= 2 ? 0 : j-2 /* PS_SOLID; PS_DASH; PS_DOT */, |
| 1710 | k, rgbbmp[i]); |
| 1711 | } |
| 1712 | for (i = 0; i < cColor; i++) { |
| 1713 | MetaCreateBrush(0 /* BS_SOLID */, rgbbmp[i]); |
| 1714 | } |
| 1715 | MetaCreateBrush(1 /* BS_NULL */, 0L); |
| 1716 | // Fonts |
| 1717 | if (gs.nFontAll > 0) |
| 1718 | for (i = 1; i < cFont; i++) { |
| 1719 | j = (CchSz(rgszFontName[i]) + 1) >> 1; |
| 1720 | MetaCreateFont(j, 0, i < fiArial ? -METAMUL*gi.nScale : yFontT, |
| 1721 | i == fiWingding ? 2 /* Symbol Charset */ : 0 /* Ansi Charset */); |
| 1722 | j = (i == fiWingding || i >= fiArial ? |
| 1723 | 1 /* Draft */ : 0 /* Default */); |
| 1724 | k = (i == fiWingding || i >= fiCourier ? |
| 1725 | 1 /* Fixed */ : 2 /* Variable */) | |
no test coverage detected