A method, device, equipment and storage medium for adjusting font rotation effect
By calculating the target image structure information and adjusting the slot position, the problems of inaccurate calculation of data area size and unreasonable slot position during font rotation are solved, thus improving the font rotation effect and the efficiency of data synchronous modification.
Patent Information
- Application Number
- CN202211248986.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-10-12
AI Technical Summary
Existing font rotation technologies suffer from inaccurate calculation of data area size and unreasonable adjustment of slot position when handling different rotation angles, resulting in poor rotation effects.
By calculating the structural information of the target image, including width, number of rows and step, the size of the target image data area is determined, and the slot position is adjusted according to the preset rotation angle to achieve efficient font rotation.
It enables accurate calculation of data area size and adjustment of slot position under different rotation angles, improving the display quality of font rotation effects and the efficiency of data synchronization modification.
Smart Images

Figure CN115471405B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of font display in computers, and in particular to a method and device for adjusting font rotation effect, equipment and a storage medium. BACKGROUND
[0002] The graphical interface of a computer system, the deformation of a font, such as bold, rotation, flip, and the like, font correction, font conversion, and the like, all belong to common operations performed on a font. Different font engines have their own algorithms in implementing various processing of a font.
[0003] CN113421257A discloses a dot matrix font text line rotation correction method and device. The method comprises: acquiring a dot matrix font text line image to be corrected; performing binaryzation processing on the dot matrix font text line image to be corrected to obtain a binaryzation image; acquiring feature point data of the dot matrix font text line according to the binaryzation image; performing rotation angle searching according to the feature point data to obtain a rotation correction angle; and performing rotation correction on the dot matrix font text line image to be corrected according to the rotation correction angle to obtain a corrected image.
[0004] CN110135530A discloses a method and system for converting Chinese character fonts in an image, a computer device, and a medium. A specific embodiment of the method comprises: acquiring strokes and spatial distribution information of strokes of a Chinese character to be converted in an image to be converted; and generating a specified font Chinese character corresponding to the Chinese character to be converted in the image to be converted according to the strokes of the Chinese character to be converted, the spatial distribution information of the strokes, and standard stroke information of a specified font, to replace the Chinese character to be converted. SUMMARY
[0005] The present application is a method for adjusting font rotation effect for performing rotation operation on a font image during development of a font engine, to realize display of font rotation.
[0006] The technical solution of the present application is as follows:
[0007] A method for adjusting font rotation effect comprises the following steps:
[0008] receiving a preset rotation instruction of a font, acquiring a bitmap mode image of the font to be rotated, calculating target image structure information according to structure information of the bitmap mode image of the font and a preset rotation angle,
[0009] determining the size of a target image data area according to the target image structure information,
[0010] then creating a target image data area according to the size of the target image data area,
[0011] rotating the to-be-rotated font according to a preset rotation angle, and storing the rotated image data into a target image data area.
[0012] The method further comprises the following steps of calculating target image structure information according to the bitmap mode image structure information of the font and the preset rotation angle.
[0013] If the preset rotation angle is 180 degrees, the target image width is the source image width, the target image row number is the source image row number, and if the pixels in the target image data area are bit patterns, the target image step is (target image width+7) / 8, and if the pixels in the target image data area are byte pixel patterns, the target image step is the target image width.
[0014] If the preset rotation angle is not 180 degrees, the target image width is the source image row number, the target image row number is the source image width, and if the pixels in the target image data area are bit patterns, the target image step is (target image width+7) / 8, and if the pixels in the target image data area are byte pixel patterns, the target image step is the target image width.
[0015] The method further comprises the following steps of determining the size of the target image data area according to the target image structure information, and the size of the target image data area is target image row number×target image step.
[0016] The method further comprises the following steps of calculating the target image structure information according to the bitmap mode image structure information of the font and the preset rotation angle, and if pixel expansion is needed during rotation, setting the target image structure as a byte pixel pattern and setting the number of gray scales supported by the target image structure as 256.
[0017] The method further comprises the following steps of calculating the target image data area coordinates after determining the size of the target image data area according to the target image structure information.
[0018] If the preset rotation angle is 90 degrees, the x coordinate of the target image data area is source image row number-1-source image y coordinate, and the y coordinate of the target image data area is source image x coordinate.
[0019] If the preset rotation angle is 180 degrees, the x coordinate of the target image data area is source image width-1-source image x coordinate, and the y coordinate of the target image data area is source image row number-1-source image y coordinate.
[0020] If the preset rotation angle is 270 degrees, the x coordinate of the target image data area is source image y coordinate, and the y coordinate of the target image data area is source image width-1-source image x coordinate.
[0021] The method further comprises, after determining the size of the target image data area according to the target image structure information, calculating slot position information, including the following steps:
[0022] If the preset rotation angle is 90 degrees, the target slot information top position = (-source image slot left position), and the target slot information left position = source image slot top position-source image row number.
[0023] If the preset rotation angle is 180 degrees, the target slot information top position = source image row number-source image slot top position, and the target slot information left position = -(source image width+1+source image slot left position).
[0024] If the preset rotation angle is 270 degrees, the target slot information top position = source image width+source image slot left position, and the target slot information left position = (-source image slot top position).
[0025] The method further comprises, after storing the rotated image data into the target image data area, copying the data of the target image data area to the source image data area.
[0026] The application also provides a device for adjusting font rotation effect, comprising:
[0027] A bitmap mode image acquisition module is configured to receive a preset rotation instruction of a font, and acquire a bitmap mode image of the font to be rotated,
[0028] A target image structure information calculation module is configured to calculate target image structure information according to bitmap mode image structure information of the font and a preset rotation angle,
[0029] A target image data area determination module is configured to determine the size of a target image data area according to the target image structure information,
[0030] A target image data area establishment module is configured to newly establish a target image data area according to the size of the target image data area,
[0031] A font rotation module is configured to rotate the font to be rotated according to the preset rotation angle, and store the rotated image data into the target image data area.
[0032] The application also provides a device for adjusting font rotation effect, comprising a processor and a memory, wherein the processor implements the method for adjusting font rotation effect when executing a computer program saved in the memory.
[0033] The application further provides a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the method for adjusting the font rotation effect.
[0034] According to the bitmap mode image structure information of the font and the preset rotation angle, the application calculates target image structure information, including width, row number, step, etc., determines the size of a target image data area, newly creates the target image data area, rotates the font to be rotated according to the preset rotation angle, and stores the rotated image data into the target image data area. Through the above operations, the data of the rotated font image is stored in the target image data area and then copied to the source image data area, which includes adjustment and optimization of the slot position, so that image rotation display and synchronous modification of the source data are realized, and the preset rotation effect is presented. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A flowchart of the method for adjusting the font rotation effect of the application;
[0036] Figure 2 A font setting interface diagram;
[0037] Figure 3 A font setting interface diagram;
[0038] Figure 4 A font setting interface diagram;
[0039] Figure 5 A diagram of the device for adjusting the font rotation effect of the application;
[0040] Figure 6 A diagram of the device for adjusting the font rotation effect of the application. DETAILED DESCRIPTION
[0041] Explanation of professional terms:
[0042] Font and font file: the same text (or character) is drawn using different fonts, which will present different appearances. And font information is saved in a file, which is called a font file.
[0043] Font engine: after a font engine loads a font file, the image of the font can be obtained to draw characters; meanwhile, the font engine also processes some effects, such as bold, italic, rotation, etc. The font engine can enable the bitmap mode or the vector mode of a character according to needs.
[0044] Vector mode: also known as vector mode, each font is described by mathematical curves, which can be conveniently deformed, such as scaling and rotation.
[0045] Bitmap mode: the information of each character is a pixel image, and the images of different font sizes are also different. According to the description, for a character with the same font and font size, the actual display effect of the vector mode and the bitmap mode may be different.
[0046] Pixel expansion. The pixels in the bitmap mode image of the font are usually one bit. If necessary, they can be expanded to bytes, and the image data area is also expanded accordingly.
[0047] Gray number. The pixels in the bitmap mode image can only represent two gray scales if they are one bit, and can represent 256 gray scales if they are one byte.
[0048] Font bitmap data structure: generally contains the following information:
[0049] Width (columns), indicating how many pixels a row has.
[0050] Number of rows (height), indicating the total number of rows of pixels.
[0051] Pitch (step), a row of pixels occupies several bytes.
[0052] Bitmap mode image data area. Generally, one bit represents one pixel.
[0053] It should be noted that the width and height of the font bitmap may be the same as or different from the actual width and height of the character. In order to ensure the correct position, a slot is needed.
[0054] Slot (Slot), containing the position information of the bitmap: top and left.
[0055] A method for adjusting the rotation effect of a font, combining Figures 1-4 , comprising the following steps:
[0056] S01: receiving a preset rotation instruction of a font, and obtaining a bitmap mode image of the font to be rotated.
[0057] Figures 1-3 Set the information of the preset input font, which contains the font, font size, rotation angle, whether to adjust the slot information, whether to expand the bitmap pixels, whether to optimize the slot information, etc. The rotation angle mainly includes 90 degrees, 180 degrees or 270 degrees.
[0058] S02: calculating target image structure information according to the bitmap mode image structure information of the font and the preset rotation angle.
[0059] The target image structure information here includes the width, the number of rows and the step information of the target image. Different designs are made according to different rotation angles, mainly according to whether the rotation angle is 180 degrees.
[0060] If the preset rotation instruction contains a setting requiring pixel expansion, the target image structure is set to a byte pixel mode, and the number of gray scales supported by the target image structure is set to 256. In the byte pixel mode and the bit mode, the calculation of the target image step will be different. The design process is as follows:
[0061] If the preset rotation angle is 180 degrees, or the preset rotation angle is not 180 degrees but the source image width is equal to the source image number of rows, the target image width is the source image width; the target image number of rows is the source image number of rows; if the pixels of the target image data area are in the bit mode, the target image step = (target image width + 7) / 8, and if the pixels of the target image data area are in the byte pixel mode, the target image step is the target image width.
[0062] If the preset rotation angle is not 180 degrees and the source image width is not equal to the source image number of rows, the target image width is the source image number of rows; the target image number of rows is the source image width; if the pixels of the target image data area are in the bit mode, the target image step = (target image width + 7) / 8, and if the pixels of the target image data area are in the byte pixel mode, the target image step is the target image width.
[0063] S03: Determine the size of the target image data area according to the target image structure information.
[0064] The size of the target image data area is calculated by the following formula:
[0065] The size of the target image data area = target image number of rows x target image step.
[0066] S04: Then, a target image data area is newly created according to the size of the target image data area.
[0067] Before the target image data area is newly created, the x and y coordinates and the slot position information of the target image data area need to be determined. The specific operation can be referred to the following steps:
[0068] If the preset rotation angle is 90 degrees, the x coordinate of the target image data area = source image number of rows - 1 - y coordinate of the source image, and the y coordinate of the target image data area is the x coordinate of the source image;
[0069] If the preset rotation angle is 180 degrees, the x coordinate of the target image data area = source image width - 1 - x coordinate of the source image, and the y coordinate of the target image data area = source image number of rows - 1 - y coordinate of the source image;
[0070] If the preset rotation angle is 270 degrees, the x coordinate of the target image data area is the y coordinate of the source image, and the y coordinate of the target image data area = the width of the source image - 1 - the x coordinate of the source image.
[0071] If the preset rotation angle is 90 degrees, the top position of the target slot information = (-the left position of the source image slot), and the left position of the target slot information = the top position of the source image slot - the number of rows of the source image.
[0072] If the preset rotation angle is 180 degrees, the top position of the target slot information = the number of rows of the source image - the top position of the source image slot, and the left position of the target slot information = -(the width of the source image + 1 + the left position of the source image slot).
[0073] If the preset rotation angle is 270 degrees, the top position of the target slot information = the width of the source image + the left position of the source image slot, and the left position of the target slot information = (-the top position of the source image slot).
[0074] Here, the slot information can be optimized according to whether the setting of the slot information is optimized in the preset rotation instruction. The optimization calculation process is as follows:
[0075] Using the optimized slot information, adjust leftDest (the left position of the target slot information). The calculation formula is: leftDest = leftDest + left optimization value.
[0076] Using the optimized slot information, adjust topDest (the top position of the target slot information). The calculation formula is: topDest = topDest + top optimization value.
[0077] S05: Rotate the to-be-rotated font according to the preset rotation angle, and store the rotated image data in the target image data area.
[0078] At this time, the target image data area stores the image data of the to-be-rotated font after rotation according to the preset rotation angle. The next step is to copy the data of the target image data area to the source image data area, update the data of the source data area, and keep the data of the source data area up to date. The copying process includes bit mode and byte pixel mode.
[0079] Copy the data of the specified position of the source image data area to the specified position of the target image data area. The process of processing bit pixels is as follows:
[0080] Calculate the byte position byteSrc of the source image data area. The calculation formula is: byteSrc = ySrc*pitchSrc + xSrc / 8;
[0081] Calculate the bit position bitSrc of the source image data area, the formula is: bitSrc = mod(xSrc, 8);
[0082] According to byteSrc and bitSrc, get the value of the corresponding position from the source image data area;
[0083] If the source value is greater than 0 and the target pixel mode is a bit pixel mode, calculate the byte position byteDest of the target image data area, the formula is: byteDest = yDest * pitchDest + xDest / 8; Calculate the bit position bitDest of the target image data area, the formula is: bitDest = mod(xDest, 8); According to byteDest and bitDest, set the corresponding position of the target image data area to the source value. If the source value is greater than 0 but the target pixel mode is not a bit pixel mode, calculate byteDest, the formula is: byteDest = yDest * pitchDest + xDest, and according to byteDest, set the corresponding position of the target image data area to 255.
[0084] Copy the data of the specified position of the source image data area to the specified position of the target image data area. The process for processing byte pixels is as follows:
[0085] Calculate the byte position byteSrc of the source image data area, the formula is: byteSrc = ySrc * pitchSrc + xSrc;
[0086] According to byteSrc, get the value of the corresponding position from the source image data area;
[0087] If the source value is greater than 0, calculate the byte position byteDest of the target image data area, the formula is: byteDest = yDest * pitchDest + xDest, and according to byteDest, set the value of the corresponding position of the target image data area to the source value.
[0088] Copy the data of the specified position of the source image data area to the specified position of the target image data area, which is a loop process with a pre-set termination condition, as follows:
[0089] If there is an image line to be processed and the processing needs to be continued, the x coordinate xSrc of the source image data area is calculated, the calculation formula is xSrc=x, the y coordinate ySrc of the source image data area is calculated, the calculation formula is ySrc=y; the x coordinate xDest and the y coordinate yDest of the target image data area are calculated (the calculation method has been provided in the above embodiment), and the data at the coordinate position of the source image data area is copied to the coordinate position of the target image data area by taking the above coordinates as parameters. The above steps are looped until there is no image line to be processed, and then it is judged whether the slot position needs to be adjusted and the slot needs to be optimized, the slot position is adjusted or optimized, and a complete copying process is ended.
[0090] The application further provides a device for adjusting a font rotation effect, as shown in Figure 5 , comprising:
[0091] a bitmap mode image acquisition module, configured to receive a preset rotation instruction of a font, and acquire a bitmap mode image of the font to be rotated,
[0092] a target image structure information calculation module, configured to calculate target image structure information according to bitmap mode image structure information of the font and a preset rotation angle,
[0093] a target image data area determination module, configured to determine the size of a target image data area according to the target image structure information,
[0094] a target image data area establishment module, configured to newly establish the target image data area according to the size of the target image data area,
[0095] a font rotation module, configured to rotate the font to be rotated according to the preset rotation angle, and store the rotated image data into the target image data area.
[0096] The device further comprises a pixel expansion module, configured to set the target image structure as a byte pixel mode and set the number of gray scales supported by the target image structure as 256 if pixel expansion is needed during rotation.
[0097] The target image structure information calculation module further comprises a target image width calculation module, configured to calculate the target image width.
[0098] a target image row number calculation module, configured to calculate the target image row number.
[0099] a target image step calculation module, configured to calculate the target image step.
[0100] The target image data area determination module further comprises a target image data area coordinate calculation module, configured to perform the following operations:
[0101] If the preset rotation angle is 90 degrees, the x coordinate of the target image data area is equal to the y coordinate of the source image minus 1 minus the x coordinate of the source image, and the y coordinate of the target image data area is equal to the x coordinate of the source image minus 1 minus the y coordinate of the source image;
[0102] If the preset rotation angle is 180 degrees, the x coordinate of the target image data area is equal to the x coordinate of the source image minus 1 minus the width of the source image, and the y coordinate of the target image data area is equal to the y coordinate of the source image minus 1 minus the row number of the source image;
[0103] If the preset rotation angle is 270 degrees, the x coordinate of the target image data area is equal to the y coordinate of the source image, and the y coordinate of the target image data area is equal to the x coordinate of the source image minus 1 minus the width of the source image.
[0104] The target image data area determination module further comprises a slot position information calculation module, configured to perform the following operations:
[0105] If the preset rotation angle is 90 degrees, the top position of the target slot information is equal to (-the left position of the source image slot), and the left position of the target slot information is equal to the top position of the source image slot minus the row number of the source image;
[0106] If the preset rotation angle is 180 degrees, the top position of the target slot information is equal to the row number of the source image minus the top position of the source image slot, and the left position of the target slot information is equal to -(the width of the source image + 1 + the left position of the source image slot);
[0107] If the preset rotation angle is 270 degrees, the top position of the target slot information is equal to the width of the source image plus the left position of the source image slot, and the left position of the target slot information is equal to (-the top position of the source image slot).
[0108] The device further comprises a data copying module configured to store the rotated image data to the target image data area, and copy the data of the target image data area to the source image data area.
[0109] The application also provides a device for adjusting font rotation effect, as shown in Figure 6 , comprising a processor and a memory, wherein the processor executes the computer program stored in the memory to realize the method for adjusting the font rotation effect.
[0110] The application also provides a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to realize the method for adjusting the font rotation effect.
[0111] The functions shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transport information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memories (ROMs), flash memories, erasable read-only memories (EROMs), floppy disks, compact discs (CD-ROMs), optical disks, hard disks, fiber-optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.
[0112] It is also important to note that the examples described herein can be implemented in a variety of systems, including and / or incorporating software, firmware, hardware, and / or circuitry. Also, the present application can be implemented as a system-on-a-chip, where each or various functional circuits or codes are actually implemented as different components of a single integrated circuit or chip. As such, the present application should not be construed that the examples described herein are limited only to the described order of execution, or that they must be executed in the described order, or that they must be executed at all. Further, one will appreciate that the examples described herein can be implemented with both object-oriented and non-object-oriented programming systems.
[0113] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. Alternatively, the computer program instructions can be downloaded to a server or other remote data processing system or device for execution.
[0114] The above merely describes specific implementation of the present application, and those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, module and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A method of adjusting a font rotation effect, characterized by The method comprises the following steps: receiving a preset rotation instruction of a font, obtaining a bitmap mode image of a font to be rotated, calculating target image structure information according to the bitmap mode image structure information of the font and a preset rotation angle, specifically: if the preset rotation angle is 180 degrees, or the preset rotation angle is not 180 degrees but the source image width is equal to the source image row number, then the target image width is the source image width; the target image row number is the source image row number; if the pixel of the target image data area is a bit mode, then the target image step = (target image width + 7) / 8, and if the pixel of the target image data area is a byte pixel mode, then the target image step is the target image width; if the preset rotation angle is not 180 degrees and the source image width is not equal to the source image row number, then the target image width is the source image row number; the target image row number is the source image width; if the pixel of the target image data area is a bit mode, then the target image step = (target image width + 7) / 8, and if the pixel of the target image data area is a byte pixel mode, then the target image step is the target image width; determining the size of the target image data area according to the target image structure information, and then comprising the following steps: if the preset rotation angle is 90 degrees, then the x coordinate of the target image data area = source image row number - 1 - y coordinate of the source image, and the y coordinate of the target image data area is the x coordinate of the source image; if the preset rotation angle is 180 degrees, then the x coordinate of the target image data area = source image width - 1 - x coordinate of the source image, and the y coordinate of the target image data area = source image row number - 1 - y coordinate of the source image; if the preset rotation angle is 270 degrees, then the x coordinate of the target image data area is the y coordinate of the source image, and the y coordinate of the target image data area = source image width - 1 - x coordinate of the source image; comprising the following steps of calculating slot position information: if the preset rotation angle is 90 degrees, then the top position of the target slot information = (-source image slot left position), and the left position of the target slot information = source image slot top position - source image row number; if the preset rotation angle is 180 degrees, then the top position of the target slot information = source image row number - source image slot top position, and the left position of the target slot information = -(source image width + 1 + source image slot left position); if the preset rotation angle is 270 degrees, then the top position of the target slot information = source image width + source image slot left position, and the left position of the target slot information = (-source image slot top position); then creating a target image data area according to the size of the target image data area, rotating the font to be rotated according to the preset rotation angle, and storing the rotated image data in the target image data area.
2. The method of claim 1, wherein determining the size of the target image data area according to the target image structure information, and the size of the target image data area = target image row number x target image step.
3. The method of claim 1, wherein According to the bit map mode image structure information of the font and the preset rotation angle, the target image structure information is calculated, and if pixel expansion is needed during rotation, the target image structure is set as a byte pixel mode, and the number of gray scales supported by the target image structure is set as 256.
4. The method of claim 1, wherein After the rotated image data is stored in the target image data area, the data of the target image data area is further copied to the source image data area.
5. An apparatus for adjusting a font rotation effect, characterized by The method comprises the steps of: a bit map mode image acquisition module, configured to receive a preset rotation instruction of a font, and acquire a bit map mode image of the font to be rotated, a target image structure information calculation module, configured to calculate target image structure information according to the bit map mode image structure information of the font and the preset rotation angle, and specifically, if the preset rotation angle is 180 degrees, or the preset rotation angle is not 180 degrees but the source image width is equal to the source image row number, the target image width is equal to the source image width, the target image row number is equal to the source image row number, if the pixel of the target image data area is a bit mode, the target image step is equal to (target image width+7) / 8, and if the pixel of the target image data area is a byte pixel mode, the target image step is equal to the target image width; if the preset rotation angle is not 180 degrees and the source image width is not equal to the source image row number, the target image width is equal to the source image row number, the target image row number is equal to the source image width, if the pixel of the target image data area is a bit mode, the target image step is equal to (target image width+7) / 8, and if the pixel of the target image data area is a byte pixel mode, the target image step is equal to the target image width; a target image data area determination module, configured to determine the size of the target image data area according to the target image structure information, and further comprising the steps of calculating the coordinates of the target image data area, and specifically, if the preset rotation angle is 90 degrees, the x coordinate of the target image data area is equal to the source image row number-1-source image y coordinate, and the y coordinate of the target image data area is equal to the source image x coordinate; if the preset rotation angle is 180 degrees, the x coordinate of the target image data area is equal to the source image width-1-source image x coordinate, and the y coordinate of the target image data area is equal to the source image row number-1-source image y coordinate; if the preset rotation angle is 270 degrees, the x coordinate of the target image data area is equal to the source image y coordinate, and the y coordinate of the target image data area is equal to the source image width-1-source image x coordinate; and further comprising the steps of calculating slot position information, comprising the following steps: if the preset rotation angle is 90 degrees, the top position of the target slot information is equal to (-source image slot left position), and the left position of the target slot information is equal to source image slot top position-source image row number; if the preset rotation angle is 180 degrees, the top position of the target slot information is equal to source image row number-source image slot top position, and the left position of the target slot information is equal to -(source image width+1+source image slot left position); if the preset rotation angle is 270 degrees, the top position of the target slot information is equal to source image width+source image slot left position, and the left position of the target slot information is equal to (-source image slot top position). The target image data area establishing module is configured to newly establish the target image data area according to a size of the target image data area, The font rotating module is configured to rotate the to-be-rotated font according to a preset rotation angle, and store the rotated image data into the target image data area.
6. A device for adjusting font rotation effects, characterized in that, comprising a processor and a memory, The processor executes the computer program stored in the memory to realize the method for adjusting the font rotation effect according to any one of claims 1-4.
7. A computer readable storage medium characterized by, A computer program is stored in the memory, and the computer program is executed by the processor to realize the method for adjusting the font rotation effect according to any one of claims 1-4.
Citation Information
Patent Citations
Method and system for converting Chinese character fonts in image, computer equipment and medium
CN110135530A
Dot matrix font text line rotation correction method and device
CN113421257A
Parallel-connected bionic eye device and control method thereof
CN105835036A