Giter Club home page Giter Club logo

Comments (3)

JujuAdams avatar JujuAdams commented on June 2, 2024

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.

wearyexcellance avatar wearyexcellance commented on June 2, 2024

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.

wearyexcellance avatar wearyexcellance commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.