Where exactly on the canvas is 'better' for textFrame?

I have a script to place elements on the screen - a rectangle and a couple of text elements.

While the position of the top and left of the rectangle falls exactly where it's supposed to, I can't quite understand what a textFrame item value means. See the code and the corresponding result - the planning of the elements of the text are slightly under the surface of the rectangle. Why and how can I accurately control the placement of the text elements, specifically the value of 'top' as it seems do not correspond to something?

// For loop

// Box
var dayBox = docRef.pathItems.rectangle( dayTop, dayLeft, dayWidth, dayHeight );
dayBox.filled = false;
dayBox.stroked = true;
dayBox.strokeColor = newColor;
dayBox.strokeWidth = sDay;

// Text
var dayNameText = docRef.textFrames.add();
var k = new Date(year, m, d);
var dayName = k.getDayNameShort(ypLang);
dayNameText.contents = dayName;
dayNameText.top = dayTop; // "top" of what?
dayNameText.left = dayLeft;
dayNameParaStyle.applyTo(dayNameText.textRange);
dayNameCharStyle.applyTo(dayNameText.textRange);

var dayNumberText = docRef.textFrames.add();
dayNumberText.contents = d + 1;
dayNumberText.top = dayTop; // ?
dayNumberText.left = dayRight;
dayNumberParaStyle.applyTo(dayNumberText.textRange);
dayNumberCharStyle.applyTo(dayNumberText.textRange);

Screen Shot 2015-11-09 at 10.47.03.png

Carlos is quite right, because your styles can change the top of the text after you set up the upper part of the block of text at the start.

To my knowledge, I did a simple test to try and analyse the 'top' of the text in the box.

#target illustrator
function test(){
    if(app.documents.length == 0){
        alert("Open a document firs");
        return;
    } else if(app.documents[0].textFrames.length == 0){
        alert("Make at least 1 text frame in the document.");
        return;
    }
    function marker(xy){
        var clr = new CMYKColor();
        clr.cyan = 0;
        clr.magenta = 100;
        clr.yellow = 100;
        clr.black = 0;
        var c = doc.pathItems.ellipse(xy[1] + 3, xy[0] - 3, 6, 6);
        c.fillColor = clr;
        c.filled = true;
        c.stroked = false;
    };
    var doc = app.activeDocument;
    doc.layers[0].visible = true;
    doc.layers[0].locked = false;
    var t = doc.textFrames[0];
    marker([t.left, t.top]);
}
test();

With the help of a red circle to mark a landmark, I determined that the upper-left coordinate of a text object is a tribute to the bounding box of the appearance of point-text of a text element.


In this image, top/left of a text box is displayed, and it's obviously above the bounding box.


Now, when the block of text is converted into Point text, using Illustrator CC, the bounding box for the text of the point coincides with the location of the top/left marker. It is obvious that for point text, the UI-show bounding box is determined somehow since glyphs.

Explore further, it seems that the area of text that is highlighted when you use editing text also honors the bounding box of the text point.


When you change one of the glyphs, the letter 'X', in a different font and more large size of the font, point-text in the text block limits are modified to account for the highest letter.

On this basis, it seems that when you work out of the bounding box of the text in the box, using areaTextItem.textPath to get the left/top would work.

Tags: Illustrator

Similar Questions

  • Where to find the best AE tutorials for beginner?

    Where to find the best AE tutorials for beginner?

    Getting started with After Effects (CS4, CS5, CS5.5, CS6, & CC). After the effects of interest area

  • Satellite P30-145: where to find the Radeon 9700 Mobility for Vista drivers

    Does anyone at - he had a success get drivers ATI Radeon Mobility 9700 to arrive correctly on a P30-145 on the RTM of Vista version? Currently, everything seems to be detected ok but I get an error in saying Device Manager: "Windows has stopped this device because it has reported problems. (Code 43) "Googling didn't turn out much more than a certain number of people see this same error and it could be necessary an update of the BIOS, or the problem may be in the area of drivers ACPI?

    Outside the upcoming graphics card not properly the only other comment I have is that system standby support doesn't seem to appear and that the cooling fan is continuously on, both of which I'm sure that can be fixed with a Toshiba release.

    All had experiences with Vista and Satellite P30?

    Hello

    I have no Satellite P30, but it will be interesting to see what kind of support Toshiba will arrange for older models of laptops and where will be the last limitation (how the old units will be supported).

    AFAIK P30 is about two years old and we will see if the units in the year 2005 will be Vista supported. Official start is January 2007. Before that I n t believe you will get official info. I just hope that my Satellite Pro M70 will be supported.

    In any case good luck!

  • Where to find the Windows 7 driver for the color Gestetner SP C220n laser printer?

    Where to find the driver for Gestetner SP C220n Windows 7 o/s?

    Moved from feedback

    Original title: Gestetner SP C220n

    Hello

    Try Ricoh > Support > downloads

    http://www.Nashuatec.com/downloads/index.aspx

    Don

  • Where to find the correct SHA1 checksum for the upgrade Pro Windows 8 ISO?

    I ordered the Windows 8 Pro upgrade online.  (not a preview but the new product on 26/10/12).  I downloaded and burned the ISO of the English version of the Windows 8 ISO file.  I'm assuming that 64-bit. This took place without incident.  I started the upgrade on a PC running Windows 7 SP1 64-bit, but it failed during the installation phase of Windows 8 to 72% with the error "installing Windows 8 failed".

    So I restarted the upgrade and it has not exactly in the same place (72%) and the same cryptic error.
    So I contacted the Microsoft Store and they helped me to go through the process of downloading a 2nd time.  The 2nd ISO file was exactly the same size, BUT it had a different SHA1 checksum!
    Then I tried the upgrade using the new DVD burned in the 2nd ISO file and it failed at exactly at the same stage of the upgrade (72%).
    So I got two corrupt downloads / Burns?   I have no way to tell because all I know is that they have different amounts of control.
    Maybe they all are both wrong, or maybe the question is something else entirely.
    But first things first.   How can I determine if my ISO file is correct?
    What is the checksum SHA1 of a non-corrupt ISO file?    Where to find the information online?

    I have the same problem with my 64-bit windows English version.

    I created a bootable DVD from iso and started to install a clean install by formatting the hard drive.
    Installation will be stuck at 17% and it happened to me like 3 times and I burned a fresh DVD and always the same question.
    It's like the worst level ever... Is there a way I can download an iso of 64-bit bootable DVD and use it to upgrade?
  • Where to buy the CD from recovery for Satellite Pro L20?

    Does anyone know where to get a copy of the recovery for the L20 CD as mine is damaged

    Hello

    The CD can be ordered from the Toshiba service provider in your country:
    _eu http://eu.Computers.Toshiba-Europe.com/cgi-bin/ToshibaCSG/generic_content.jsp?service=eu&ID=Support_Homepage

    Follow the link and choose the point of finding a certified service provider

  • Where to get the replacement drive recovery for Satellite 2450

    Hello

    Miss me the recovery for my 2450 disk, anyone know where I can get a replacement?
    It is running a bit slow and you want to re - install XP

    Thank you

    Michael

    Hi Michael

    You didn't check other threads in this category and didn t find the answer. Am I wrong? ;)
    This question has been asked and posted several times here in the forum, however. because you are a new user, I'll try to help you.
    So in general all devices, Toshiba, s CD, etc. can be ordered and purchased from authorized service provider.

    So just to say, communicate with the guys from the services in your country and you will get the new recovery CD :)

  • Satego X 200 - 21U - where to find the XP SATA driver for install XP

    I have laptop Satego X 200 - 21U with installed Windows Vista.
    Where can I find the driver for SATA drive so I could install Windows XP?
    HARD drive is Hitachi hts 541616j9sa00.

    Hello

    The SATA driver is part of the Intel Storage Manager.
    You can download the Storage Manager Intel since the European driver Toshiba page.

    The package contains the F6hlpy folder that contains the files needed for the SATA.

    These files must be included for the Windows XP CD using free software called nLite.

    Google for nLite to get and find more details.

    Good bye

  • Where to find the XP SATA driver for install XP on Satellite L40 - 12 x

    I should add that drivers of nLite for windows instakltion disck where can I find these drivers?
    I have the model L40-12 x or L40 PSL40e

    Check the Intel page for the Intel Matrix Storage Manager

  • Where to buy the upgrade of RAM for my Satellite M30-344?

    Hello

    I want to upgrade my RAM from 512 MB to 2 GB memory. After reading in the nets, he would say the PC 2700 DDR SODIMM (33135 PA-2MIG) would correspond to my laptop. Anyone know where to buy it? could not find it on ebay and other suppliers of portable... Is it too old and trade off already?

    See you soon,.

    Kat

    Where to buy?

    Hey buddy don't you hear something on the shops online, amazon, ebay, etc.  ;)

    If you know what Rams are compatible, then simply google for some nice offers.

    You can also buy it at a computer retailer in the city center

    As you can see, you have more options.

    Good bye

  • Where to get the authentec fingerprint drivers for various computers laptops hp that supports the functionality of the biometric device in windows 7?

    Hello

    We build a Windows 7 SOE for a large company that takes care of many models of computers laptops hp. Each of these laptops comes with a fingerprint reader, and we would like to use the built in support of fingerprint (biometric devices) reader that is running windows 7. The models that we support are as follows:

    • HP 6910P
    • HP 6930p
    • HP 8510w
    • HP 8530w

    We tried using the drivers of fingerprint Authentec (aes2501a) on the hp website, but after the installation, the biometric device option is not in windows 7. We contacted HP about this and they said that we must use the driver coming from windows update before this option appears. After installing the driver from windows update, the option of the biometric device seemed that hp said. Therefore, because of the way that our SOE is built, we demand that the executable that is identical to that on windows update. Anyone know where we can find packages both x 64 and x 86 for this device driver, which are the same as those found when you go to update windows on these machines running windows 7? Let me know if you need any clarification.

    Thank you

    Hi Mustapha ETS.

    Step 1: Locate the stand-alone file by inserting the device model number
    a. visit http://catalog.update.microsoft.com/v7/site/Home.aspx
    in the search box, enter the model number of the perimeter search of the driver.
    c. download the right driver for your windows and install it successfully on all computers.

    Note: If there is no available stand-alone file, I'm afraid you'll have to visit update of Windows on all computers and the installation of the update done or contact the device manufacturer to obtain the driver.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Where is stored the Windows 8 wallpaper for the lockscreen?

    Hi all

    on the first Preview of Windows 8, I created a screen lock Wallpaper. Now, on all machines, I use Windows 8, it uses this cool wallpaper of lock. But only on my account. I want to use for another account, but I can't find anywhere locally.

    On all machines (new) I connect with my MS Account, this cool wallpaper for lock screen appears, so it must be stored somewhere?

    Anyone know where to find or how I can recover my current desktop wallpaper of Windows 8 lock so I can use it on other accounts?

    Thanks in advance!

    Here is the man.

    C:\Windows\Web\Screen

  • Satellite A300D-15B: where to find the software cam Chicony for Win7

    I recently did a clean install of windows 7 64 bit on my Satellite A300D-15B and I was wondering were I can download Chicony camera assistant software go?

    At soon Avo

    Hello

    You can try the driver for the webcam for Vista OS.
    I installed driver webcam Chicony for Vista on my device Windows 7 preinstalled.
    It worked like charm!

    Try it!

  • Satellite A500-1EE - where to find the 32-bit drivers for Windows 7?

    Welcome!

    I have the Satellite A500-1EE with the 64 bit version of Windows 7 and I need to install the 32-bit version of this system. Is this possible?

    Because I can not find the drivers for 32 bit.

    Hi tosipaw,

    Of course, it is possible and you can install what you want on your laptop, but I put t understand why you want to change to 64-bit to 32-bit OS.
    What are the reasons for that?

    Normally everything can be downloaded here:
    http://EU.computers.Toshiba-Europe.com > support & downloads > download drivers

    Your model belongs to the series of PSAR9E and so only drivers 64-bit available.

    If you are looking for all models A500 (without PSAR9E), you will find a large number of drivers Vista 32 bit. Maybe they work and it s worth a try! :)

  • Where to find the driver Hotkey Utility for Satellite M115-S3094

    Hello

    recently bought a Toshiba Satellite M115-s3094 laptop and you want to install the utility driver hotkey.
    Can't find it in the download from toshibas support website.

    Thank you

    Satellite M115-S3094 was designed for the American market.
    Each Toshiba laptop with the 5 at the end of the model number is a laptop Toshiba us and is why we search the Toshiba site we needed software.
    http://www.CSD.Toshiba.com/cgi-bin/TAIS/Su/su_sc_home.jsp

    Good luck

Maybe you are looking for

  • Database of stolen devices

    Hello. Apple has a database where the victims of theft could enter the serial number of the unit, so that a person who wants to buy a used device can check the serial number? My MacBook Pro was stolen 2 days in San Francisco, the Golden Gate Park. Th

  • Apple pay help

    phone is version 9.3.4 region is US I have reset all settings the buttons holding high and home to restart portfolio app has not yet pay Apple and it appears under my icloud settings which gives iPhone 5s so this is important

  • Netflix problem

    When I go to netflix, my that I do not see the 'delete '' x' "that the page is too wide. I can go to internet explore and delete movies in my Quebec with x, he provided. I can't reduce my firefox page to the low enough to see the 'x '. How narrow the

  • extraction of data on broken laptop

    My laptop is saying there is Aproblem in the start screen, I need to extract a date before restoing manafactoring settings

  • IE cannot display the webpage, updated constantly, hesitations and constant delays

    constantly get IE cannot display Web pages, constantly having to refresh the page in facebook, the constant delays and hesitations by clicking from one page to the other