Get statistics about font-manager glyph caches
long PfGetCacheStats( FontStats *ptsStats,
unsigned long ulFlags);
ph
This function retrieves the current statistics relating to the number of hits/attempts of the respective font-manager glyph caches.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <Ap.h>
#include <Ph.h>
#include <Pt.h>
#include <errno.h>
int main(int argc, char *argv[])
{ double Percentage;
FontStats tsStat;
PtInit (NULL);
if(PfGetCacheStats(&tsStat, PHF_STATS) == -1)
{ perror("");
exit(-1);
}
printf("PHF - Hits: %d, Attempts: %d\n",
tsStat.uiCacheHits, tsStat.uiTotalAttempts);
Percentage = (double)((double)tsStat.uiCacheHits /
(double)tsStat.uiTotalAttempts);
printf("PHF Cache hit percentage: %f\n", Percentage);
if(PfGetCacheStats(&tsStat, TTF_STATS) == -1)
{ perror("");
exit(-1);
}
printf("TTF - Hits: %d, Attempts: %d\n",
tsStat.uiCacheHits, tsStat.uiTotalAttempts);
Percentage = (double)((double)tsStat.uiCacheHits /
(double)tsStat.uiTotalAttempts);
printf("TTF Cache hit percentage: %f\n", Percentage);
if(PfGetCacheStats(&tsStat, PFR_STATS) == -1)
{ perror("");
exit(-1);
}
printf("PFR - Hits: %d, Attempts: %d\n",
tsStat.uiCacheHits, tsStat.uiTotalAttempts);
Percentage = (double)((double)tsStat.uiCacheHits /
(double)tsStat.uiTotalAttempts);
printf("PFR Cache hit percentage: %f\n", Percentage);
return(0);
}
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
Fonts chapter of the Photon Programmer's Guide