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.3 KiB

  1. /*++
  2. Copyright (c) 1996 - 1999 Microsoft Corporation
  3. Module Name:
  4. qeryfont.c
  5. Abstract:
  6. Implementation of Functions to answer font queries from the engine.
  7. Environment:
  8. Windows NT Unidrv driver
  9. Revision History:
  10. 12/19/96 -ganeshp-
  11. Created
  12. --*/
  13. #include "font.h"
  14. PIFIMETRICS
  15. FMQueryFont(
  16. PDEV *pPDev,
  17. ULONG_PTR iFile,
  18. ULONG iFace,
  19. ULONG_PTR *pid
  20. )
  21. /*++
  22. Routine Description:
  23. Returns the IFIMETRICS of the nominated font.
  24. Arguments:
  25. pPDev Pointer to PDEV
  26. iFile This is the identifier of the driver font file.
  27. iFace Font index of interest, first is # 1
  28. pid Can be used by driver to id or flag the return data
  29. Return Value:
  30. Pointer to the IFIMETRICS of the requested font. NULL on error.
  31. Note:
  32. 11-18-96: Created it -ganeshp-
  33. --*/
  34. {
  35. //
  36. // This is not too hard - verify that iFace is within range, then
  37. // use it as an index into the array of FONTMAP structures hanging
  38. // off the PDEV! The FONTMAP array contains the address of the
  39. // IFIMETRICS structure!
  40. //
  41. FONTPDEV *pFontPDev;
  42. FONTMAP *pfm;
  43. pFontPDev = PFDV;
  44. //
  45. // This can be used by the driver to flag or id the data returned.
  46. // May be useful for deletion of the data later by DrvFree().
  47. //
  48. *pid = 0; // dont really need to do anything with it
  49. if( iFace == 0 && iFile == 0 )
  50. {
  51. return (IFIMETRICS *)IntToPtr(pPDev->iFonts);
  52. }
  53. if( iFace < 1 || (int)iFace > pPDev->iFonts )
  54. {
  55. SetLastError( ERROR_INVALID_PARAMETER );
  56. ERR(( "iFace = %ld WHICH IS INVALID\n", iFace ));
  57. return NULL;
  58. }
  59. pfm = PfmGetDevicePFM( pPDev, iFace );
  60. return pfm ? pfm->pIFIMet : NULL;
  61. }
  62. ULONG
  63. FMGetGlyphMode(
  64. PDEV *pPDev,
  65. FONTOBJ *pfo
  66. )
  67. /*++
  68. Routine Description:
  69. Tells engine how we want to handle various aspects of glyph
  70. information.
  71. Arguments:
  72. pPDev Pointer to PDEV.
  73. pfo The font in question?.
  74. Return Value:
  75. Information about glyph handling.
  76. Note:
  77. 11-18-96: Created it -ganeshp-
  78. --*/
  79. {
  80. return FO_GLYPHBITS;
  81. }