Comments (3)
This is an upstream bug in GameMaker unfortunately. I am not in a position to fix this or make a bug report to YYG. This will not be fixed for quite some time.
from scribble.
Hello there, i found a fix for this bug :
All you have to do is use this function :
`function adjust_arabic_text(argument0){
// This function does the whole letters' adjustment.
if (string_length(argument0) > 1)
{
var i, intermed = "", result = "";
// Fusing اللام and الألف.
for (i = 0; i < string_length(argument0); i++)
{
if (string_char_at(argument0, i + 1) == chr(1604) && i < string_length(argument0) - 1) // Detecting اللام.
switch (string_char_at(argument0, i + 2)) {
case chr(1570) : intermed += chr(65269); break;
case chr(1571) : intermed += chr(65271); break;
case chr(1573) : intermed += chr(65273); break;
case chr(1575) : intermed += chr(65275); break;
default : intermed += chr(1604);
}
else
if !((string_char_at(argument0, i + 1) == chr(1570) || string_char_at(argument0, i + 1) == chr(1571) ||
string_char_at(argument0, i + 1) == chr(1573) || string_char_at(argument0, i + 1) == chr(1575)) && (i > 0 && string_char_at(argument0, i) == chr(1604)))
intermed += string_char_at(argument0, i + 1);
}
for (i = 0; i < string_length(intermed); i++)
{
// If the character doesn't belong to the Arabic alphabet, add it right away.
if (get_unicode(string_char_at(intermed, i + 1), 1) == -1) result += string_char_at(intermed, i + 1);
else
{
// Fixing the first character in a word.
if (i == 0 || (i > 0 && i != string_length(intermed) - 1 && get_unicode(string_char_at(intermed, i), 1) == -1))
{
if (!get_unicode(string_char_at(intermed, i + 1), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
if ((get_unicode(string_char_at(intermed, i + 2), 1) != -1) &&
(get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 3)))
// Add the beginning form.
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 2);
else
// Add the standard form (isolated).
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
}
else
// Fixing the last character in a word.
if (i == string_length(intermed) - 1 || (i < string_length(intermed) - 1 && i != 0 && get_unicode(string_char_at(intermed, i + 2), 1) == -1))
{
if (!get_unicode(string_char_at(intermed, i + 1), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
if ((get_unicode(string_char_at(intermed, i), 1) != -1) &&
(get_unicode(string_char_at(intermed, i), 2) != 0) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 2)))
// Add the end form.
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
else
// Add the standard form (isolated).
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
}
else
// Fixing the characters in the middle.
if (i != 0 && i != string_length(intermed) - 1 &&
get_unicode(string_char_at(intermed, i), 1) != -1 && get_unicode(string_char_at(intermed, i + 2), 1) != -1)
{
// If the character is isolated.
if (get_unicode(string_char_at(intermed, i + 1), 2) == 0)
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
{
// It comes before or after an isolated character.
if (!get_unicode(string_char_at(intermed, i), 2) || !get_unicode(string_char_at(intermed, i + 2), 2))
{
// Between two isolated characters.
if (!get_unicode(string_char_at(intermed, i), 2) && !get_unicode(string_char_at(intermed, i + 2), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
// After an isolated character.
if (!get_unicode(string_char_at(intermed, i), 2))
if ((get_unicode(string_char_at(intermed, i + 1), 3)) &&
(get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 1), 4)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 2);
else
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
// Before an isolated character.
if (!get_unicode(string_char_at(intermed, i + 2), 2))
if ((get_unicode(string_char_at(intermed, i + 1), 2)) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
else
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
}
else
// The end character follows a character that doesn't come at end.
if (!(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)) &&
!(get_unicode(string_char_at(intermed, i + 1), 3)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
// The character is between two middle characters and it is a middle character.
if ((get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 4)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 3);
else
// The character is between two middle characters and it is an end character.
if ((get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 2)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
else
// The character is before an end characters and it is a beginning character.
if (get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4) &&
get_unicode(string_char_at(intermed, i + 1), 3))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 2);
else
// The character is after a beginning characters and it is an end character.
if (get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4) &&
get_unicode(string_char_at(intermed, i + 1), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
}
}
}
}
return (result);
}
else
return argument0;
}
`
from scribble.
Hello there, i found a fix for this bug :
All you have to do is use this function :
`function adjust_arabic_text(argument0){
// This function does the whole letters' adjustment.
if (string_length(argument0) > 1)
{
var i, intermed = "", result = "";
// Fusing اللام and الألف.
for (i = 0; i < string_length(argument0); i++)
{
if (string_char_at(argument0, i + 1) == chr(1604) && i < string_length(argument0) - 1) // Detecting اللام.
switch (string_char_at(argument0, i + 2)) {
case chr(1570) : intermed += chr(65269); break;
case chr(1571) : intermed += chr(65271); break;
case chr(1573) : intermed += chr(65273); break;
case chr(1575) : intermed += chr(65275); break;
default : intermed += chr(1604);
}
else
if !((string_char_at(argument0, i + 1) == chr(1570) || string_char_at(argument0, i + 1) == chr(1571) ||
string_char_at(argument0, i + 1) == chr(1573) || string_char_at(argument0, i + 1) == chr(1575)) && (i > 0 && string_char_at(argument0, i) == chr(1604)))
intermed += string_char_at(argument0, i + 1);
}
for (i = 0; i < string_length(intermed); i++)
{
// If the character doesn't belong to the Arabic alphabet, add it right away.
if (get_unicode(string_char_at(intermed, i + 1), 1) == -1) result += string_char_at(intermed, i + 1);
else
{
// Fixing the first character in a word.
if (i == 0 || (i > 0 && i != string_length(intermed) - 1 && get_unicode(string_char_at(intermed, i), 1) == -1))
{
if (!get_unicode(string_char_at(intermed, i + 1), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
if ((get_unicode(string_char_at(intermed, i + 2), 1) != -1) &&
(get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 3)))
// Add the beginning form.
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 2);
else
// Add the standard form (isolated).
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
}
else
// Fixing the last character in a word.
if (i == string_length(intermed) - 1 || (i < string_length(intermed) - 1 && i != 0 && get_unicode(string_char_at(intermed, i + 2), 1) == -1))
{
if (!get_unicode(string_char_at(intermed, i + 1), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
if ((get_unicode(string_char_at(intermed, i), 1) != -1) &&
(get_unicode(string_char_at(intermed, i), 2) != 0) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 2)))
// Add the end form.
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
else
// Add the standard form (isolated).
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
}
else
// Fixing the characters in the middle.
if (i != 0 && i != string_length(intermed) - 1 &&
get_unicode(string_char_at(intermed, i), 1) != -1 && get_unicode(string_char_at(intermed, i + 2), 1) != -1)
{
// If the character is isolated.
if (get_unicode(string_char_at(intermed, i + 1), 2) == 0)
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
{
// It comes before or after an isolated character.
if (!get_unicode(string_char_at(intermed, i), 2) || !get_unicode(string_char_at(intermed, i + 2), 2))
{
// Between two isolated characters.
if (!get_unicode(string_char_at(intermed, i), 2) && !get_unicode(string_char_at(intermed, i + 2), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
// After an isolated character.
if (!get_unicode(string_char_at(intermed, i), 2))
if ((get_unicode(string_char_at(intermed, i + 1), 3)) &&
(get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 1), 4)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 2);
else
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
// Before an isolated character.
if (!get_unicode(string_char_at(intermed, i + 2), 2))
if ((get_unicode(string_char_at(intermed, i + 1), 2)) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
else
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
}
else
// The end character follows a character that doesn't come at end.
if (!(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)) &&
!(get_unicode(string_char_at(intermed, i + 1), 3)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1));
else
// The character is between two middle characters and it is a middle character.
if ((get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 4)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 3);
else
// The character is between two middle characters and it is an end character.
if ((get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4)) &&
(get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4)) &&
(get_unicode(string_char_at(intermed, i + 1), 2)))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
else
// The character is before an end characters and it is a beginning character.
if (get_unicode(string_char_at(intermed, i + 2), 2) || get_unicode(string_char_at(intermed, i + 2), 4) &&
get_unicode(string_char_at(intermed, i + 1), 3))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 2);
else
// The character is after a beginning characters and it is an end character.
if (get_unicode(string_char_at(intermed, i), 3) || get_unicode(string_char_at(intermed, i), 4) &&
get_unicode(string_char_at(intermed, i + 1), 2))
result += chr(get_unicode(string_char_at(intermed, i + 1), 1) + 1);
}
}
}
}
return (result);
}
else
return argument0;
}
`
from scribble.
Related Issues (20)
- Proper "highlight" effect for regions HOT 1
- .seek() method for typists
- Multiple colors for text, like draw_text_colo(u)r? HOT 2
- Option for `.sound_per_char()` to cut off sound if one is already playing HOT 1
- Option to only scale down non-sprite glyphs with scale_to_box() and fit_to_box()
- Allow `[typistSoundPerChar,...]` to take an array as an argument, like the base function HOT 1
- Being able to ban/allow assets for Scribble
- Word splitting sometimes causes problems with bbox calculation
- [help]About the conflict between setting colors and #macro HOT 2
- ds_map_find_value argument 1 invalid reference to (ds_map) HOT 2
- There was an error whilst reading "sprite_font: spr_sprite_font" HOT 13
- being able to insert a character at the start of a new line HOT 1
- Add optional argument such that MSDF font pxrange is scaled by scribble_font_scale() HOT 1
- Implement 4-corner gradients HOT 1
- Surface tag broken on GM 2023.11
- scribble_font_bake_outline_8dir crashes in 2023.11.1.160 runtime HOT 2
- how to draw background? HOT 1
- Scribble crashes my game! HOT 7
- Can't run the project with scribble, it returns compile errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scribble.