locked
asp.net web page accessing foreign languages RRS feed

  • Question

  • User-1581369485 posted

    In an existing visual Basic.net web form application the application is currently written in English. Now the user new additional web pages to be in the Nepali, Karen, and Burmese languages.

    I do know that certain fonts can be loaded to my workstation and the web pages in the languages I listed above do display. I would like the foreign language fonts to be loaded somehow on the application server, so I do not need to install the foreign languages fonts on each person's computers. I would like the application to also know where the fonts are located so the foreign language fonts  can be accessed. 

    The new page pages are displayed when a user wants to bring up a 'letter' and then edits the letter for the particular customer. When the letter is being edited, the 'letter' looks like a Word document where fonts can be listed and the user can change the font.

    Thus can you tell me if what I suggested is possible? If so, can you tell me how to accomplish my goal and/or point me to a link(s) that I can use as a reference?

    Saturday, June 8, 2019 3:01 AM

All replies

  • User1520731567 posted

    Hi jazzgirl,

    jazzgirl

    I do know that certain fonts can be loaded to my workstation and the web pages in the languages I listed above do display. I would like the foreign language fonts to be loaded somehow on the application server, so I do not need to install the foreign languages fonts on each person's computers. I would like the application to also know where the fonts are located so the foreign language fonts  can be accessed. 

    You could invoke font js packages and call it in view,such as:Google Fonts API...

    jazzgirl

    The new page pages are displayed when a user wants to bring up a 'letter' and then edits the letter for the particular customer. When the letter is being edited, the 'letter' looks like a Word document where fonts can be listed and the user can change the font.

    Do you mean the effect of a rich text editor?I suggest you could use this kind of plugin,such as:KindEditor or code it by javascript,

    for example,this is my simple demo:

    <html>
    <head>
    
        <link href="https://fonts.googleapis.com/css?family=Oswald|Tangerine&display=swap" rel="stylesheet">//invoke font js packages
        <style>
            h1 {
                font-family: 'Oswald', sans-serif;
                font-size: 48px;
            }
    
            h2 {
                font-family: 'Tangerine', sans-serif;
                font-size: 48px;
            }
        </style>
    </head>
    <body>
        <h1>Embedded Font Demo</h1>
        <h2>Embedded Font Demo</h2>
        Select your font: <select id="Selectfont">
            <option value="Oswald">Oswald</option>
            <option value="Tangerine">Tangerine</option>
    
        </select>
    
    
        <div contenteditable="true" id="note_header" style="width:200px; height:200px; border: 1px solid #ccc"></div>
    
    
    </body>
    </html>
    <script src="~/Scripts/jquery-3.3.1.min.js"></script>
    @section scripts{
        <script type="text/javascript">
           
            var selectText = "";
            $(function () {          
                $('#Selectfont').change(function (event) {
                    var font = $(event.target).val();
                    selectedText = window.getSelection().toString();
    
                    var newContent = $('#note_header').html().replace(selectedText, '<span style="font-family:' + font + ';">' + selectedText + '</span>');
                    $('#note_header').html(newContent);
                });
    
                function getSelectionText() {
                    var text = "";
                    var activeEl = document.activeElement;
    
                    text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
    
                    return text;
                }
    
            });
        </script>
        }
    

    How it works:

    Best Regards.

    Yuki Tao

    Tuesday, June 11, 2019 5:33 AM
  • User-1581369485 posted

    The application is using a third party tool that looks like a 'Word' editor on the web. Do you think your suggestion will work with a third party tool editor that is obtained from the Progress Vendor?

    Tuesday, June 11, 2019 7:57 PM