ENGLISH TRANSLATION
I understand your request for updating the code to generate groups of images with different styles based on user preferences from the command line. The following procedure shows how to achieve this:
1. Modify ProccessArguments:
You will need to modify the ProccessArguments procedure to include all possible style combinations based on user preferences. You can use bitwise combinations and add a new parameter for XNOR. Here's an example of how to do it:
pascal
if s.include_XOR then begin s.Groups := [TSBold, TSItalic]; // Only "bold" group and "italic" group end else if s.include_XNOR then begin s.Groups := [TSNormal, TSBoldItalic]; // Only "normal" group and "bolditalic" group end else begin s.Groups := []; if s.Bold then s.Groups := s.Groups + [TSBold]; if s.Italic then s.Groups := s.Groups + [TSItalic]; if s.BoldItalic then s.Groups := s.Groups + [TSBoldItalic]; end;
This way, you prepare the s.Groups array containing all desired style combinations.
2. Modify TMyApplication.Create:
pascal
forGroupStyle in s.Groups dobegin // Set the font style for the group to be processed case GroupStyle of TSNormal: bmp.Canvas.Font.Style := [];// call a function to generate group of images withbmp.Canvas.Font.StyleTSBold: bmp.Canvas.Font.Style := [fsBold];// call a function to generate group of images withbmp.Canvas.Font.StyleTSItalic: bmp.Canvas.Font.Style := [fsItalic];// call a function to generate group of images withbmp.Canvas.Font.StyleTSBoldItalic: bmp.Canvas.Font.Style := [fsBold, fsItalic];// call a function to generate group of images withbmp.Canvas.Font.Styleend; // Continue with the rest of the code to generate current group of images with a predefined style end;
This way, the code will generate images for all style combinations based on user preferences.
This is a general idea of how to make this modification. You should also ensure that folder and file names are generated to reflect the current style combination, which could be part of the folder and file names.
CZECH TRANSLATION
Rozumím vašim požadavkům na aktualizaci kódu, abyste mohl generovat skupiny obrázků s různými styly na základě preferencí uživatele z příkazové řádky. Následující postup ukazuje, jak toho dosáhnout:
1. Úprava ProccessArguments:
Budete muset upravit proceduru ProccessArguments, aby obsahovala všechny možné kombinace stylů podle preferencí uživatele. Můžete použít kombinace bitových operací a přidat nový parametr pro XNOR. Zde je příklad, jak to provést:
pascal
if s.include_XOR then begin s.Groups := [TSBold, TSItalic]; // Pouze skupina "bold" a skupina "italic" end else if s.include_XNOR then begin s.Groups := [TSNormal, TSBoldItalic]; // Pouze skupina "normal" askupina"bolditalic" end else begin s.Groups := []; if s.Bold then s.Groups := s.Groups + [TSBold]; if s.Italic then s.Groups := s.Groups + [TSItalic]; if s.BoldItalic then s.Groups := s.Groups + [TSBoldItalic]; end;
Tímto způsobem připravíte pole s.Groups obsahující všechny žádoucí kombinace stylů.
2. Úprava TMyApplication.Create:
Zde je příklad, jak to provést:
pascal
for Style in s.Groups do begin // Nastavte styl fontu na základě aktuální kombinace v `Style` case Style of TSNormal: bmp.Canvas.Font.Style := [];// zde zavolej funci na vygenerování obrázků se stylybmp.Canvas.Font.StyleTSBold: bmp.Canvas.Font.Style := [fsBold];// zde zavolej funci na vygenerování obrázků se stylybmp.Canvas.Font.StyleTSItalic: bmp.Canvas.Font.Style := [fsItalic];// zde zavolej funci na vygenerování obrázků se stylybmp.Canvas.Font.StyleTSBoldItalic: bmp.Canvas.Font.Style := [fsBold, fsItalic];// zde zavolej funci na vygenerování obrázků se stylybmp.Canvas.Font.Styleend; // Zde můžete pokračovat ve zbytku kódu pro generování obrázků s aktuálním stylem end;
Tímto způsobem bude kód generovat obrázky pro všechny kombinace stylů podle preferencí uživatele.
Toto je obecný nápad na to, jak by bylo možné provést tuto úpravu. Měli byste také zajistit, že názvy složek a souborů se generují tak, aby odrážely aktuální kombinaci stylů, což by mohlo být součástí názvu složky a názvu souboru.