Преглед на файлове

REVIEWED: LoadFontEx()

Changed parameters order for consistency with LoadFontData() and other functions when an array is passed by parameter and array size is the following parameter.
pull/708/head
raysan5 преди 6 години
родител
ревизия
96207a8a02
променени са 5 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. +1
    -1
      examples/textures/textures_image_text.c
  2. +1
    -1
      games/transmission/screens/screen_ending.c
  3. +1
    -1
      games/transmission/screens/screen_gameplay.c
  4. +1
    -1
      src/raylib.h
  5. +2
    -2
      src/text.c

+ 1
- 1
examples/textures/textures_image_text.c Целия файл

@ -21,7 +21,7 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [texture] example - image text drawing");
// TTF Font loading with custom generation parameters
Font font = LoadFontEx("resources/KAISG.ttf", 64, 95, 0);
Font font = LoadFontEx("resources/KAISG.ttf", 64, 0, 0);
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)

+ 1
- 1
games/transmission/screens/screen_ending.c Целия файл

@ -123,7 +123,7 @@ void InitEndingScreen(void)
// Generate newspaper with title and subtitle
Image imNewspaper = LoadImage("resources/textures/ending_newspaper.png");
fontNews = LoadFontEx("resources/fonts/Lora-Bold.ttf", 32, 250, 0);
fontNews = LoadFontEx("resources/fonts/Lora-Bold.ttf", 32, 0, 250);
ImageDrawTextEx(&imNewspaper, (Vector2){ 50, 220 }, fontNews, headline, fontNews.baseSize, 0, DARKGRAY);
texNewspaper = LoadTextureFromImage(imNewspaper);

+ 1
- 1
games/transmission/screens/screen_gameplay.c Целия файл

@ -126,7 +126,7 @@ void InitGameplayScreen(void)
framesCounter = 0;
finishScreen = 0;
fontMessage = LoadFontEx("resources/fonts/traveling_typewriter.ttf", 30, 250, 0);
fontMessage = LoadFontEx("resources/fonts/traveling_typewriter.ttf", 30, 0, 250);
texBackground = LoadTexture("resources/textures/message_background.png");
texVignette = LoadTexture("resources/textures/message_vignette.png");

+ 1
- 1
src/raylib.h Целия файл

@ -1095,7 +1095,7 @@ RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle
// Font loading/unloading functions
RLAPI Font GetFontDefault(void); // Get the default Font
RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM)
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int n">charsCount, int *fontChars); // Load font from file with extended parameters
RLAPI Font LoadFontEx(const char *fileName, int fontSize, int o">*fontChars, int charsCount); // Load font from file with extended parameters
RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style)
RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use
RLAPI Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info

+ 2
- 2
src/text.c Целия файл

@ -275,7 +275,7 @@ Font LoadFont(const char *fileName)
Font font = { 0 };
#if defined(SUPPORT_FILEFORMAT_TTF)
if (IsFileExtension(fileName, ".ttf") || IsFileExtension(fileName, ".otf")) font = LoadFontEx(fileName, DEFAULT_TTF_FONTSIZE, ">DEFAULT_TTF_NUMCHARS, NULL);
if (IsFileExtension(fileName, ".ttf") || IsFileExtension(fileName, ".otf")) font = LoadFontEx(fileName, DEFAULT_TTF_FONTSIZE, b">NULL, DEFAULT_TTF_NUMCHARS);
else
#endif
#if defined(SUPPORT_FILEFORMAT_FNT)
@ -301,7 +301,7 @@ Font LoadFont(const char *fileName)
// Load Font from TTF font file with generation parameters
// NOTE: You can pass an array with desired characters, those characters should be available in the font
// if array is NULL, default char set is selected 32..126
Font LoadFontEx(const char *fileName, int fontSize, int n">charsCount, int *fontChars)
Font LoadFontEx(const char *fileName, int fontSize, int o">*fontChars, int charsCount)
{
Font font = { 0 };

Зареждане…
Отказ
Запис