{"action":"created","issue":{"url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx/issues/205","repository_url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx","labels_url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx/issues/205/comments","events_url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx/issues/205/events","html_url":"https://github.com/jmcnamara/excel-writer-xlsx/issues/205","id":303809906,"number":205,"title":"problem with set_column() width","user":{"login":"brpays","id":37212600,"avatar_url":"https://avatars2.githubusercontent.com/u/37212600?v=4","gravatar_id":"","url":"https://api.github.com/users/brpays","html_url":"https://github.com/brpays","followers_url":"https://api.github.com/users/brpays/followers","following_url":"https://api.github.com/users/brpays/following{/other_user}","gists_url":"https://api.github.com/users/brpays/gists{/gist_id}","starred_url":"https://api.github.com/users/brpays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brpays/subscriptions","organizations_url":"https://api.github.com/users/brpays/orgs","repos_url":"https://api.github.com/users/brpays/repos","events_url":"https://api.github.com/users/brpays/events{/privacy}","received_events_url":"https://api.github.com/users/brpays/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-09T11:25:24Z","updated_at":"2018-03-09T13:22:01Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI have an issue when setting the column width of an XLSX file if I modify the size of default font size.\r\n\r\n```perl\r\n#!/usr/bin/perl\r\nuse v5.16; \r\n\r\nuse strict;\r\nuse warnings;\r\nuse utf8;\r\nuse Excel::Writer::XLSX;\r\n\r\nmy $workbook    = Excel::Writer::XLSX->new( 'test_workbook.xlsx', { default_format_properties => { font => 'Calibri', size => 12 } } );\r\nmy $worksheet   = $workbook->add_worksheet( 'sheet1' );\r\n\r\n$worksheet->set_column( 0, 0, 20 );\r\n$worksheet->set_column( 1, 1, 30 );\r\n$worksheet->set_column( 2, 2, 40 );\r\n$worksheet->set_row( 0, 20 );\r\n$worksheet->set_row( 1, 30 );\r\n$worksheet->set_row( 2, 40 );\r\n\r\n$workbook->close();\r\n```\r\n\r\n[test_workbook.xlsx](https://github.com/jmcnamara/excel-writer-xlsx/files/1796669/test_workbook.xlsx)\r\n\r\n![column1](https://user-images.githubusercontent.com/37212600/37205362-cb72d59a-2394-11e8-9c24-27f997274cab.JPG)\r\n![column2](https://user-images.githubusercontent.com/37212600/37205363-cb90157e-2394-11e8-8c61-7577cb3a17b1.JPG)\r\n\r\nThe expected column size was 20 and 30.\r\n"},"comment":{"url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx/issues/comments/371810390","html_url":"https://github.com/jmcnamara/excel-writer-xlsx/issues/205#issuecomment-371810390","issue_url":"https://api.github.com/repos/jmcnamara/excel-writer-xlsx/issues/205","id":371810390,"user":{"login":"jmcnamara","id":94267,"avatar_url":"https://avatars3.githubusercontent.com/u/94267?v=4","gravatar_id":"","url":"https://api.github.com/users/jmcnamara","html_url":"https://github.com/jmcnamara","followers_url":"https://api.github.com/users/jmcnamara/followers","following_url":"https://api.github.com/users/jmcnamara/following{/other_user}","gists_url":"https://api.github.com/users/jmcnamara/gists{/gist_id}","starred_url":"https://api.github.com/users/jmcnamara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmcnamara/subscriptions","organizations_url":"https://api.github.com/users/jmcnamara/orgs","repos_url":"https://api.github.com/users/jmcnamara/repos","events_url":"https://api.github.com/users/jmcnamara/events{/privacy}","received_events_url":"https://api.github.com/users/jmcnamara/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T13:22:01Z","updated_at":"2018-03-09T13:22:01Z","author_association":"OWNER","body":"> I have an issue ... if I modify the size of default font size.\r\n\r\nColumn widths and row heights in Excel depend on the default font for the workbook/worksheet.\r\n\r\nSo if you change the default font size (which isn't exposed publicly) then the calculations for row and column will change. This also in turn affects the calculations for worksheet objects sizing such as images, charts and comments.\r\n\r\nYou can potentially work around this by setting the following worksheet parameters for the font you define:\r\n\r\n```perl\r\n    $self->{_default_row_height}  = 15;\r\n    $self->{_default_row_pixels}  = 20;\r\n    $self->{_default_col_pixels}  = 64;\r\n```\r\n\r\nHowever, since all of this is internal to Excel::Writer::XLSX and not intentionally publicly exposed, I'm going to close this issue."}}
{"actor":{"display_login":"jmcnamara"}}