Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. pclxlcmn.h
  5. Abstract:
  6. PCL XL minidriver common utility
  7. Environment:
  8. Windows Whistler
  9. Revision History:
  10. 08/23/99
  11. Created it.
  12. --*/
  13. #include "xlpdev.h"
  14. #include "xldebug.h"
  15. #include "pclxle.h"
  16. #include "xlgstate.h"
  17. PBYTE
  18. PubGetFontName(
  19. PDEVOBJ pdevobj,
  20. ULONG ulFontID)
  21. /*++
  22. Routine Description:
  23. Create PCL XL base font name for TrueType font.
  24. We just know ID for the font.
  25. Arguments:
  26. Font ID.
  27. Return Value:
  28. Base font name string.
  29. Note:
  30. --*/
  31. {
  32. PXLPDEV pxlpdev= (PXLPDEV)pdevobj->pdevOEM;
  33. //
  34. // FaceName initialization "MS PCLXLFont 123"
  35. // This name has to be in sync with GPD file.
  36. //
  37. pxlpdev->ubFontName[16] = NULL;
  38. pxlpdev->ubFontName[15] = (BYTE)(ulFontID % 10 + '0');
  39. ulFontID = ulFontID / 10;
  40. pxlpdev->ubFontName[14] = (BYTE)(ulFontID % 10 + '0');
  41. ulFontID = ulFontID / 10;
  42. pxlpdev->ubFontName[13] = (BYTE)(ulFontID % 10 + '0');
  43. return (PBYTE)&(pxlpdev->ubFontName[0]);
  44. }
  45. ROP4
  46. UlVectMixToRop4(
  47. IN MIX mix
  48. )
  49. /*++
  50. Routine Description:
  51. Convert a MIX parameter to a ROP4 parameter
  52. Arguments:
  53. mix - Specifies the input MIX parameter
  54. Return Value:
  55. ROP4 value corresponding to the input MIX value
  56. --*/
  57. {
  58. static BYTE Rop2ToRop3[] = {
  59. 0xFF, // R2_WHITE
  60. 0x00, // R2_BLACK
  61. 0x05, // R2_NOTMERGEPEN
  62. 0x0A, // R2_MASKNOTPEN
  63. 0x0F, // R2_NOTCOPYPEN
  64. 0x50, // R2_MASKPENNOT
  65. 0x55, // R2_NOT
  66. 0x5A, // R2_XORPEN
  67. 0x5F, // R2_NOTMASKPEN
  68. 0xA0, // R2_MASKPEN
  69. 0xA5, // R2_NOTXORPEN
  70. 0xAA, // R2_NOP
  71. 0xAF, // R2_MERGENOTPEN
  72. 0xF0, // R2_COPYPEN
  73. 0xF5, // R2_MERGEPENNOT
  74. 0xFA, // R2_MERGEPEN
  75. 0xFF // R2_WHITE
  76. };
  77. return ((ROP4) Rop2ToRop3[(mix >> 8) & 0xf] << 8) | Rop2ToRop3[mix & 0xf];
  78. }