Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock void GetTabulation(char[] str, char[] buffer, int maxlength)
- {
- char symbols[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:- "; //
- int size[] = {6, 6, 6, 6, 6, 5, 6, 6, 2, 4, 6, 2, 10, 6, 6, 6, 6, 4, 6, 5, 6, 7, 9, 7, 7, 6, 9, 7, 7, 7, 7, 7, 7, 7, 2, 7, 7, 6, 9, 8, 7, 7, 7, 7, 7, 7, 7, 8, 12, 7, 8, 7, 5, 6, 6, 8, 6, 6, 6, 6, 6, 6, 2, 2, 2, 8};
- int totalWidth, idx;
- for(int i, len = strlen(str); i < len; i++)
- {
- if((idx = FindCharInString(symbols, str[i])) != -1)
- {
- totalWidth += size[idx] + BTW_WIDTH;
- }
- }
- int tab = RoundFloat(float(BLOCK_WIDTH - totalWidth) / float(TAB_WIDTH));
- switch(tab)
- {
- case 1: FormatEx(buffer, maxlength, "\t");
- case 2: FormatEx(buffer, maxlength, "\t\t");
- case 3: FormatEx(buffer, maxlength, "\t\t\t");
- default: FormatEx(buffer, maxlength, "\t\t\t\t");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement